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

Questions about the new

From
Sergio <sergio.callegari@gmail.com>
Date
Oct 12, 2009, 10:23 UTC
Message-ID
<loom.20091012T115746-719@post.gmane.org>
Hi,

I read from the release notes of git 1.6.5 about the new "replace" mechanism. It is presented as "a replacement of the "grafts" mechanism, with the added advantage that it can be transferred across repositories."

Since there is still little information about it, I would like to ask the following:

1) Grafts and replace entries seem to operate on different aspects of the
history graph. Grafts operate on arcs and replace on nodes. 
As such, replace entries seem less general to me. 
Apparently, to simulate a graft with replace entries, you need to introduce
extra commit objects. For instance, if object B has no parents, to pretend that
it derives from some A, one needs to create an object B' equivalent to B but
for the parents and then replace B by B', is this right? Conversely, I guess
you can always simulate a replace entry with the graft mechanism, without the
need to add any extra commit object. Am I overlooking something? 
2) Is it currently possible to use a replace entry to replace a commit object
with nothing? Namely if B has A as its sole parent, is it possible to have a
replace entry such as A-sha1 becomes null, to pretend that B is a hierarchy
root?  
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?
Thanks,
Sergio
Next: David Kågedal
Message 1 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.