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

Re: Problem with git-svn

From
EWEric Wong <normalperson@yhbt.net>
Date
Dec 22, 2007, 04:29 UTC
Message-ID
<20071222042924.GA18812@soma>
In-Reply-To
<476AD1AB.8040406@gmail.com>
Pascal Obry <pascal.obry@gmail.com> wrote:
Show 22 quoted lines
> Eric,
> 
> > Ah, oops, I was off-by-one with the revision number.  But git-svn does
> > look to be doing the right thing here, because it followed history into
> > /importfromcvs/trunk/ and file.el was part of it.
> 
> Yes part of it but before the creation of the /importfromcvs/trunk/ that
> was moved later as /trunk/PROJ.
> 
> < I meant moved as /trunk/PROJ1 then /trunk/PROJ2... and so on.
>
> In /importfromcvs/trunk/ there was many projects imported. One per one,
> each time moving it into /trunk/PROJ.
> 
> If I look at history of /trunk/PROJ:
> 
>    $ svn log svn+ssh://myserver/trunk/PROJ
> 
> The last revision is 45775, so I think git-svn should not look past this
> revision. So I'm very surprised by the current behavior and think it is
> a bug to import file.el at revision 9458. Note that the workaround for
> me is to use:

Since r48468 was where /importfromcvs/trunk got renamed into /trunk/PROJ (from your previous message http://mid.gmane.org/4764FE2C.1010103@obry.net)

/importfromcvs/trunk exists at r45775, but /trunk/PROJ does not; and git-svn at least follows that (which is what I suppose everybody wants).

However...

Did /importfromcvs/trunk exist all the way between r9458 and r48468? Or was that directory replaced entirely by something else along the way?

git-svn may be following copy history too aggressively, in this case.

On the other hand, this was somewhat intended because it could also be a way to track merges as "moving" tags[1].

>    $ git svn clone svn+ssh://myserver/trunk/PROJ --revision=45775:HEAD
> 
> But it would be lot cleaner to have git-svn handling this properly I think.

Does --no-follow-parent work in your case? Or does it go too far in stopping at r48468 (probably).

[1] - I follow a project that has a RELEASE branch that is occasionally deleted and replaced with the contents of trunk. git-svn will actually import this as a merge commit with two parents:

  1. trunk (obviously)
  2. the previous RELEASE, which was deleted

This allows old (but deleted) history to still be visible, which is what *I* always want. However, it could cause undesired behavior in your case...

Note that running 'svn log <URL of #2 case>' will NOT show what git-svn log will show for two; and I think it's nice that git-svn will track history that is harder to find with SVN

(which would require svn log -v <URL of #2 case>@<rev>).
Maybe another switch should be added (--merge-foster-parent?)
-- 
Eric Wong
Previous: Pascal ObryNext: Pascal Obry
Message 9 of 11 in “Problem with git-svn”
  1. Pascal ObryDec 16, 2007
  2. Peter BaumannDec 16, 2007
  3. Pascal ObryDec 16, 2007
  4. Eric WongDec 19, 2007
  5. Pascal ObryDec 19, 2007
  6. Eric WongDec 20, 2007
  7. Pascal ObryDec 20, 2007
  8. Pascal ObryDec 21, 2007
  9. Eric WongDec 22, 2007
  10. Pascal ObryDec 22, 2007
  11. Pascal ObryDec 20, 2007

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.