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
JIJM Ibanez <jm@orangeandbronze.com>
Date
Jan 24, 2008, 08:44 UTC
Message-ID
<87wspzobnq.fsf@adler.orangeandbronze.com>
In-Reply-To
<4797D6C6.207@vilain.net>
Sam Vilain <sam@vilain.net> writes:
Show 29 quoted lines
> JM Ibanez wrote:
>> Hi,
>> 
>> I've been trying to convert an existing git-svn clone to noMetadata
>> (i.e. get rid of git-svn-id in the commit messages), primarily because
>> I've been using it to track two SVN repos which were originally just a
>> single repo-- they have the same UUID but are located on different
>> machines, and have branched significantly, so content-wise are no longer
>> the same repo.
>> 
>> Because the two repos have a single line of commits which they share, it
>> would be best if I could store that history in my git repo (as I need to
>> use it for merging between the two trees). Graphically, my current
>> history looks something like this:
>> 
>> 
>>     A -- B -- C -- D -- E -- a -- b -- c
>> 
>>     A'-- B'-- C'-- D'-- E'-- x -- y -- z
>> 
>> where, in reality, this should be represented as:
>> 
>>     A -- B -- C -- D -- E -- a -- b -- c
>>                          \
>>                           +- x -- y -- z
>
> Stop.
>
> Use a graft.  in .git/info/grafts, put (expanding to the full SHA1s):

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?

-- 
JM Ibanez
Software Architect
Orange & Bronze Software Labs, Ltd. Co.

jm@orangeandbronze.com
http://software.orangeandbronze.com/
Previous: Sam VilainNext: Sam Vilain
Message 3 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.