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

Re: Joining historical repository using grafts or replace

From
Christian Couder <christian.couder@gmail.com>
Date
Oct 30, 2014, 16:54 UTC
Message-ID
<CAP8UFD3_fAWRdxQgAbfxYZSzrmy1Aza=nuZh-uSJsKOdRj+LVA@mail.gmail.com>
In-Reply-To
<CA+POfmvCiNBF=P-OvQBTROVhaLtOdgNTDgPNyS=97bupSGk=4g@mail.gmail.com>
Hi,
On Thu, Oct 30, 2014 at 4:39 PM, Dmitry Oksenchuk <oksenchuk89@gmail.com> wrote:
Show 12 quoted lines
> Hello,
>
> We're in the middle of conversion of a large CVS repository (20 years,
> 70K commits, 1K branches, 10K tags) to Git and considering two
> separate Git repositories: "historical" with CVS history and "working"
> created without history from heads of active branches (10 active
> branches). This allows us to have small fast "working" repository for
> developers who don't want to have full history locally and ability to
> rewrite history in "historical" repository (for example, to add
> parents to merge commits or to fix conversion mistakes) without
> affecting commit hashes in "working" repository (the hashes can be
> stored in bug tracker or in the code).

This might be a good idea. Did you already test that the small repository is really faster than the full repository?

Show 13 quoted lines
> The first idea was to use grafs to join branch roots in "working"
> repository with branches in "historical" repository like in linux
> repository but it seems that grafts are known as a "horrible hack" (
> http://marc.info/?l=git&m=131127600030310&w=2
> http://permalink.gmane.org/gmane.comp.version-control.git/177153 )
>
> Since Git 1.6.5 "replace" can also be used to join the histories by
> replacing branch roots in "working" repository with branch heads in
> "historical" repository.
>
> Both grafts and replace will be used locally. Grafts is a bit easier
> to distribute (simple copying, replaces should be created via bash
> script).
First, you might want to have a look at:
http://git-scm.com/book/en/v2/Git-Tools-Replace
as it looks like it describes your use case very well.
> Are there any disadvantages of using grafts and replace? Will both of
> them be supported in future versions of Git?
My opinion is that grafts have no advantage compared to replace refs.

Once you have created your replace refs, they can be managed like other git refs, so they are easier to distribute.

Basically if you want to get the full history on a computer you just need to do:
git fetch 'refs/replace/*:refs/replace/*'

Best, Christian.

Previous: Dmitry OksenchukNext: Dmitry Oksenchuk
Message 4 of 8 in “Joining historical repository using grafts or replace”
  1. Dmitry OksenchukOct 30, 2014
  2. W. Trevor KingOct 30, 2014
  3. Dmitry OksenchukOct 30, 2014
  4. Christian CouderOct 30, 2014
  5. Dmitry OksenchukOct 30, 2014
  6. Christian CouderOct 31, 2014
  7. Dmitry OksenchukOct 31, 2014
  8. Christian CouderNov 1, 2014

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.