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

Re: Questions about the new

From
David Kågedal <davidk@lysator.liu.se>
Date
Oct 12, 2009, 10:47 UTC
Message-ID
<871vl8ubw8.fsf@lysator.liu.se>
In-Reply-To
<loom.20091012T115746-719@post.gmane.org>
Sergio <sergio.callegari@gmail.com> writes:
Show 5 quoted lines
> 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."

Grafts allow you to change a little part of commit objects (the parent relationship). Replacements allow (and require) you to change the whole commit object. So obviously, anything you can do with grafts can be done with replacements.

If you have your A-B-x-x-x history and want to remove A from the history, you replace B with a commit object that is identical, except for the missing parent link to A.

Replacements allow you do to other kinds of changes as well (comments, authorshiips) and changes to other object(?), so it is a much more general mechanism.

But I missed the discussion about it, so I'm not sure why it was felt it was needed, or why the grafts mechanism wasn't enough.

-- 
David Kågedal
Previous: SergioNext: Johannes Sixt
Message 2 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.