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

Re: Questions about the new refs/replace mechanism

From
Jakub Narebski <jnareb@gmail.com>
Date
Oct 13, 2009, 21:33 UTC
Message-ID
<m3skdnf08l.fsf_-_@localhost.localdomain>
In-Reply-To
<4AD31EBF.6090307@viscovery.net>
Johannes Sixt <j.sixt@viscovery.net> writes:
> Sergio schrieb:
Show 9 quoted lines
> > 3) If I remember correctly, there was a reason why grafts were not
> > considered suitable for transferring across repos. Can someone
> > remind me about it? How does the replace mechanism address this
> > issue?
> 
> The problem with grafts was that, for example, git-pack-objects obeyed the
> graft, and could create a broken repository by removing grafted-away
> objects. And since git-fsck also obeyed the graft, it did not notice the
> breakage.

To be more detailed, the problem is that if git-pack-objects, git-fsck and git-gc obeys grafts, it can create broken repository by removing grafted away objects. If git-pack-objects, git-fsck and git-gc doesn't obey grafts, it can created broken repository (well, broken if we include grafts) by removing grafted in objects.

Show 5 quoted lines
> 
> OTOH, history walkers (upload-pack, send-pack, pack-objects) and fsck
> never obey replace entries in the history. But they do keep track of them
> (and the history that they reference) because they are referenced from the
> refs/replace namespace.

In the case of refs/replace git-pack-objects, git-fcsk and git-gc doesn't "obey" refs/replace... but replaced objects are protected by pruning by being referenced from refs/replace ref.

One of problems with grafts file was to come up with rule what do do if both repository you fetch from and the repository you fetch into have both grafts; in the case of refs/replace the usual rules about (conflicting) refs apply.

It is also easy to select whether to follow refs/replace or not: you fetch them into your refs/replace or not; you would have to add extra option to git-fetch to select whether to fetch and follow grafts in remote you fetch from.

-- 
Jakub Narebski
Poland
ShadeHawk on #git
Previous: Dmitry Potapov
Message 9 of 9 in “Questions about the new”
  1. SergioOct 12, 2009
  2. David KågedalOct 12, 2009
  3. Johannes SixtOct 12, 2009
  4. Sergio CallegariOct 12, 2009
  5. Junio C HamanoOct 12, 2009
  6. Sergio CallegariOct 13, 2009
  7. Christian CouderOct 12, 2009
  8. Dmitry PotapovOct 12, 2009
  9. Jakub NarebskiOct 13, 2009

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.