git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: removing content from git history

From
Shawn O. Pearce <spearce@spearce.org>
Date
Feb 21, 2007, 21:00 UTC
Message-ID
<20070221210045.GB26525@spearce.org>
In-Reply-To
<Pine.LNX.4.64.0702210934470.4043@woody.linux-foundation.org>
Linus Torvalds <torvalds@linux-foundation.org> wrote:
Show 7 quoted lines
> Anyway, git-convert-objects does kind of give you a starting point. It 
> should be fixed to use "git-fast-import" or repack once in a while (so 
> that it doesn't leave tons and tons of unpacked objects), and it should be 
> fixed to fix up any commit messages that mention SHA1's that it has 
> already converted to something else, but it seems to still work. It would 
> not be impossible at all to extend the tree-rewriting logic to remove some 
> file or a particular SHA1 object you want to replace.

One idea Junio and I kicked around on #git a short while ago was to arrange for a pipe between the current Git process and git-fast-import, where the pipe was used from within write_sha1_file() rather than creating the loose object.

This way an existing process like git-apply or git-convert-objects could easily spew hundreds of thousands of objects without needing to worry about repacking in the middle; nor would we need to worry about the complexity of trying to disentagle the multiobject packing parts of fast-import into some sort of library.

Obviously this is only a good idea if we are going to be making enough objects to warrant using a packfile; small 10-20 bursts of objects from a git-apply doesn't really justify a packfile. But applying 100s of patches in a row might, if we could keep them all fed through the same git-fast-import backend (and thus into the same packfile).

-- 
Shawn.
Previous: Linus TorvaldsNext: Linus Torvalds
Message 6 of 25 in “removing content from git history”
  1. Michael HendricksFeb 21, 2007
  2. Shawn O. PearceFeb 21, 2007
  3. J. Bruce FieldsFeb 21, 2007
  4. Linus TorvaldsFeb 21, 2007
  5. Linus TorvaldsFeb 21, 2007
  6. Shawn O. PearceFeb 21, 2007
  7. Linus TorvaldsFeb 21, 2007
  8. Shawn O. PearceFeb 21, 2007
  9. Bill LearOct 9, 2007
  10. J. Bruce FieldsOct 9, 2007
  11. Bill LearOct 9, 2007
  12. Johannes SchindelinOct 10, 2007
  13. Linus TorvaldsFeb 21, 2007
  14. Nicolas PitreFeb 21, 2007
  15. Linus TorvaldsFeb 21, 2007
  16. Nicolas PitreFeb 21, 2007
  17. Michael HendricksFeb 21, 2007
  18. Shawn O. PearceFeb 21, 2007
  19. Linus TorvaldsFeb 21, 2007
  20. Linus TorvaldsFeb 21, 2007
  21. Nicolas PitreFeb 21, 2007
  22. Junio C HamanoFeb 21, 2007
  23. Nicolas PitreFeb 21, 2007
  24. Junio C HamanoFeb 21, 2007
  25. Nicolas PitreFeb 21, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.