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

"git svn fetch" on a branch is broken after "git svn reset"

From
ADAlbert Dvornik <dvornik+git@gmail.com>
Date
Jan 5, 2011, 06:22 UTC
Message-ID
<AANLkTikhaPP0bHEEeFf_2RgK_bdE-i+gaCKopfQjqgHP@mail.gmail.com>
The documentation for git svn claims that this should work:
    git svn reset -r2 -p
    git svn fetch

But when I tried it (using an SVN tree that has recent commits only in a branch, not the trunk), it didn't work correctly. "fetch" grabbed just the latest version from SVN, and not all revs from <revnum> to the head! Note that it matters that this is in an SVN branch-- if I repeat the test using revs in the trunk, everything works as expected.

Specifically, what I did was this:
    git co -b testing refs/remotes/test-branch
    git svn fetch
    git svn reset -r 850
    # does correctly rewind to rev 850, undoing commits in test-branch
    git svn fetch
    # oops, only fetches the *head* revision (rev 856) from SVN!
    # In refs/remotes/test-branch, SVN rev 850 is now followed by 856!

I then tried this again, but between reset and fetching I manually edited .git/svn/.metadata and moved back the *-maxRev versions to 850; after doing this, the fetch does the right thing. I tried examining the logic in git-svn.perl to figure out why this happens and why it would be affecting a branch but not the trunk, but I didn't get very far.

I can reproduce the problem on Linux (git version 1.7.2.1) and Windows (Git for Windows version 1.7.3.2.msysgit.0.4.ga4f3f or Cygwin git 1.7.2.3).

Thoughts?
--bert
Next: Albert Dvornik
Message 1 of 2 in “"git svn fetch" on a branch is broken after "git svn reset"”
  1. Albert DvornikJan 5, 2011
  2. Albert DvornikJan 6, 2011

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.