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

Re: git filter-branch should run git gc --auto

From
Sam Vilain <sam@vilain.net>
Date
Jan 23, 2008, 05:07 UTC
Message-ID
<4796CB78.2070607@vilain.net>
In-Reply-To
<60D6C8F5-EF88-48F0-92CA-8E49838C0CB9@sb.org>
Kevin Ballard wrote:
Show 9 quoted lines
> I'm actually considering what the cost would be of switching macports  
> to git (not that it will ever happen - too many anonymous people pull  
> from svn trunk). Right now the svn trunk contains a subfolder for the  
> source code and another subfolder for all ~4400+ Portfiles. In such a  
> theoretical move, I'd want to split that up, probably into two  
> unrelated branches. Doing so would mean running git-filter-branch over  
> a linear commit history that's 31580 objects long, with a tree filter  
> to prune the dports directory away and a msg filter to remove the svn- 
> id stuff that git-svn left behind.
You could have used git-svn --no-metadata :)

Using a commit filter to implement the pruning will be much faster; you'll need to make a temporary index, use git-read-tree, git-rm, then git-commit. This way you avoid the expense of checking out the files just to delete them in your rewrite hook.

> I'd also have to  
> figure out some way to remove the commit objects entirely that only  
> reference the dports directory. 
This can be done with a parent filter.
Show 5 quoted lines
> I'd suggest a patch to run git gc --auto, but it looks like you just  
> did in a subsequent email. As for your comments about the reflogs,  
> can't I disable recording those, at least temporarily? I'd rather  
> clean up after myself as I work rather than balloon the repository and  
> collapse it in a single operation at the end.
Honestly, the optimisation I mention above will save you much more time.
 Note that you can run git-repack -d every half hour out of cron, it is
safe and will let it clean as you go.
Sam.
Previous: Kevin BallardNext: Kevin Ballard
Message 21 of 27 in “git-svn should default to --repack”
  1. Kevin BallardJan 18, 2008
  2. Karl HasselströmJan 18, 2008
  3. Junio C HamanoJan 18, 2008
  4. Karl HasselströmJan 19, 2008
  5. Kevin BallardJan 19, 2008
  6. Let "git svn" run "git gc --auto" occasionallyKarl Hasselström, Jan 19, 2008
  7. Harvey HarrisonJan 19, 2008
  8. Eric WongJan 20, 2008
  9. Karl HasselströmJan 20, 2008
  10. Junio C HamanoJan 20, 2008
  11. Eric WongJan 21, 2008
  12. Junio C HamanoJan 22, 2008
  13. Eric WongJan 22, 2008
  14. Junio C HamanoJan 22, 2008
  15. git filter-branch should run git gc --autoKevin Ballard, Jan 23, 2008
  16. Junio C HamanoJan 23, 2008
  17. Junio C HamanoJan 23, 2008
  18. Kevin BallardJan 23, 2008
  19. Harvey HarrisonJan 23, 2008
  20. Kevin BallardJan 23, 2008
  21. Sam VilainJan 23, 2008
  22. Kevin BallardJan 23, 2008
  23. Mike HommeyJan 23, 2008
  24. Johannes SchindelinJan 23, 2008
  25. Junio C HamanoJan 23, 2008
  26. 1/2 git-svn: Don't call git-repack anymoreKarl Hasselström, Jan 20, 2008
  27. 2/2 Let "git svn" run "git gc --auto" occasionallyKarl Hasselström, Jan 20, 2008

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.