* "git svn fetch" on a branch is broken after "git svn reset"
@ 2011-01-05 6:22 Albert Dvornik
2011-01-06 5:00 ` Albert Dvornik
0 siblings, 1 reply; 2+ messages in thread
From: Albert Dvornik @ 2011-01-05 6:22 UTC (permalink / raw)
To: git
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: "git svn fetch" on a branch is broken after "git svn reset"
2011-01-05 6:22 "git svn fetch" on a branch is broken after "git svn reset" Albert Dvornik
@ 2011-01-06 5:00 ` Albert Dvornik
0 siblings, 0 replies; 2+ messages in thread
From: Albert Dvornik @ 2011-01-06 5:00 UTC (permalink / raw)
To: git
[-- Attachment #1: Type: text/plain, Size: 1988 bytes --]
Here is a reproducer using a very simple public SVN repo.
[I spent a bit of effort on trying to figure out what's going on, but
git-svn code, er, has a learning curve. =) After a reset, fetch_all()
correctly backs up $base when fetching on the trunk, but not on the
branch, because $gs->rev_map_max returns a correctly reset value in
one case but not the other. This may be because $fetch ALWAYS seems
to refer to the trunk; is that supposed to be the case?]
--bert Dvornik
On Wed, Jan 5, 2011 at 1:22 AM, Albert Dvornik <dvornik+git@gmail.com> wrote:
> 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
>
[-- Attachment #2: svn-reset-test.sh --]
[-- Type: application/x-sh, Size: 2517 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-01-06 5:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-05 6:22 "git svn fetch" on a branch is broken after "git svn reset" Albert Dvornik
2011-01-06 5:00 ` Albert Dvornik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).