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

Re: Stripping 'git-svn-id' from commit messages, and switching to svn.noMetadata

From
Sam Vilain <sam@vilain.net>
Date
Jan 24, 2008, 21:14 UTC
Message-ID
<4798FFA9.7010601@vilain.net>
In-Reply-To
<87wspzobnq.fsf@adler.orangeandbronze.com>
JM Ibanez wrote:
Show 29 quoted lines
> Actually, I forgot to mention that I already have grafts between the two
> to track merges I performed previously. So, in fact, the history looks
> like something this:
> 
>      A -- B -- C -- D -- E -- a -- b -- c -- d -- e -- f -- m3
>                          \         \          \             /
>                           \         \          \   /-------+
>      A'-- B'-- C'-- D'-- E'-- x -- y -- m1-- z -- m2
> 
> 
> where x, m1, m2, and m3 are squashed merge commits + grafts.
> 
> After git filter-branch with a graft of x to E, I get x having two
> parents as what is needed *but* because the parent IDs are part of the
> commit object, I now get x' y', etc, something like this:
> 
> 
> 
>      A -- B -- C -- D -- E -- a -- b -- c -- ...
>                          |         |
>                          |         |
>                          |         +--- m1'- z'-- m2' -- ...
>                          \         \
>                           \         \
>                            -- x -- y -- m1-- z -- ...
> 
> 
> sort of. In any case, I get duplicate commits of m1, z, etc. after the
> primary graft point. Is this expected?

I think you need to use a parent filter that looks up the old commit ID in the grafts, and adjusts the parents accordingly. I don't think I'd be able to nail it down any further than that without actually trying.

I think the intent of git filter-branch's grafting support is that this shouldn't happen, so if you can produce a test case then the bug can likely be fixed.

Sam.
Previous: JM IbanezNext: Pascal Obry
Message 4 of 7 in “Stripping 'git-svn-id' from commit messages, and switching to svn.noMetadata”
  1. JM IbanezJan 23, 2008
  2. Sam VilainJan 24, 2008
  3. JM IbanezJan 24, 2008
  4. Sam VilainJan 24, 2008
  5. Pascal ObryJan 24, 2008
  6. Sam VilainJan 24, 2008
  7. Pascal ObryJan 25, 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.