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

Re: Truncating and cleaning a imported git repositary to make it more usable

From
ABAlex Bennee <kernel-hacker@bennee.com>
Date
Mar 28, 2008, 13:08 UTC
Message-ID
<b2cdc9f30803280608y501147c0tc02f43196bda4bf7@mail.gmail.com>
In-Reply-To
<32541b130803280550u2ed23b5auc84bf935d5344e84@mail.gmail.com>
On Fri, Mar 28, 2008 at 12:50 PM, Avery Pennarun <apenwarr@gmail.com> wrote:
Show 9 quoted lines
> On 3/28/08, Alex Bennee <kernel-hacker@bennee.com> wrote:
>  >  I've succeeded in porting our whole CVS repository into git (with plenty
>  >  of swap, cvsps is very memory hungry). Now we have a reference
>  >  historical repository I need to think about creating one we actually use
>  >  for day to day use (the .git is currently in the order of 650Mb which is
>  >  a little heavy for pushing around DSL links willy nilly).
>
>  You used git-repack and git-gc, right?  If not, the repo will be
>  bigger than it should be.

Oh yes. Unfortunately for 7 years of development of an embedded platform there is a lot of cruft in the CVS repo :-(.

However as it needs to be a drop in replacement for the current repo we can't just drop all the history and start from a fresh repo.

>  >  1. Find the common ancestor point for all the product branches I want to
>  >  keep in the repo.
>  "git show-branch -a" probably does what you want.
Cool. Or in fact git-show-branch --merge-base seems to be the baby.

I'm sure it's been mentioned before but the plethora of git commands can make it hard to find the commands you want even if your sure there is some way of doing it :-)

Show 14 quoted lines
>  >  2. Create a new repo, starting at the common ancestor point
>  >
>  >   2(a). I'd need to remove the orphaned old CVS modules which are still
>  >  around but not referenced any more.
>  >
>  >  3. Create the product branches and import ANCESTOR..BRANCH_HEAD into
>  >  them
>
>  You probably want to look at git-filter-branch, particularly the
>  --parent-filter option.
>
>  Note that 2(a) would be easiest if you just did it before importing
>  from CVS at all, since it's easy to remove old modules from CVS just
>  by moving the files out of the way.

Trouble is looking at the current repo I'm not sure which modules are orphans (at the common anscestor point) and which have been added since.

Of course now I can easily go back in time (easier than in CVS) I can build up this list.

>  Have fun,
For certain values of fun ;-)
-- 
Alex, homepage: http://www.bennee.com/~alex/
Previous: Avery PennarunNext: Alex Bennee
Message 3 of 14 in “Truncating and cleaning a imported git repositary to make it more usable”
  1. Alex BenneeMar 28, 2008
  2. Avery PennarunMar 28, 2008
  3. Alex BenneeMar 28, 2008
  4. Alex BenneeMar 28, 2008
  5. Alex BenneeMar 28, 2008
  6. Johannes SixtMar 28, 2008
  7. Documentation: Another example for git-filter-branchAlex Bennee, Mar 28, 2008
  8. Mike HommeyMar 28, 2008
  9. Alex BenneeMar 29, 2008
  10. Jakub NarebskiMar 29, 2008
  11. Johannes SixtMar 31, 2008
  12. Jeff KingMar 28, 2008
  13. Jeff KingMar 28, 2008
  14. Michael HaggertyMar 29, 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.