threads / discuss / 24237

purpose of -r flag for git-svn fetch

Subject: purpose of -r flag for git-svn fetch

## tl;dr

3 messages between Jun 30, 2010 and Jun 30, 2010.

replies: 2people: 2as markdown or json

Bradley Wagner· Jun 30, 2010, 02:29 UTC · lore

I've tried doing git-svn fetch in batches because it takes too long to do it all at once.

    git svn -r1:5000 fetch
    git svn -r5000:10000 fetch
    git svn -r10000:15000 fetch

Strangely, after this is done if I look in the history with "git log", I only see commits on master branch up through the 5000th revision of the SVN repository. Someone told me to then call git-svn rebase to fix it. What does "-r" actually do when invoked on consecutive calls to "git-svn fetch" and why does git-svn rebase appear to fix it?

I posted this question to Stackoverflow before realizing that this list is a better audience for it: http://stackoverflow.com/questions/3144683/master-branch-missing-revisions-after-sequential-git-svn-fetch-calls

Thanks!
Will Palmer· Jun 30, 2010, 08:40 UTC · re: Bradley Wagner · lore

Re: purpose of -r flag for git-svn fetch

On Tue, 2010-06-29 at 22:29 -0400, Bradley Wagner wrote:
Show 12 quoted lines
> I've tried doing git-svn fetch in batches because it takes too long to
> do it all at once.
> 
>     git svn -r1:5000 fetch
>     git svn -r5000:10000 fetch
>     git svn -r10000:15000 fetch
> 
> Strangely, after this is done if I look in the history with "git log",
> I only see commits on master branch up through the 5000th revision of
> the SVN repository. Someone told me to then call git-svn rebase to fix
> it. What does "-r" actually do when invoked on consecutive calls to
> "git-svn fetch" and why does git-svn rebase appear to fix it?

The keyword here is "fetch". "fetch" only retrieves data into the remote-tracking branch (often called refs/remotes/git-svn), without updating your local branches. "git svn rebase", on the other hand, rebases your currently-checked-out branch to be based on the git-svn remote ref. (note that "git svn rebase" does a "git svn fetch" behind-the-scenes first, and is actually just "git svn fetch" followed by a normal "git rebase")

The concepts are the same as if you were using the regular git commands "fetch" and "rebase", so the man pages for those may offer some insight.

Show 10 quoted lines
> 
> I posted this question to Stackoverflow before realizing that this
> list is a better audience for it:
> http://stackoverflow.com/questions/3144683/master-branch-missing-revisions-after-sequential-git-svn-fetch-calls
> 
> Thanks!
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Bradley Wagner· Jun 30, 2010, 13:32 UTC · re: Will Palmer · lore

Re: purpose of -r flag for git-svn fetch

Hmm, this makes sense, but why does the initial fetch then update my local branch and if I call subsequent fetches without the "-r" it will fetch new revisions and update my local branch.

On Wed, Jun 30, 2010 at 4:40 AM, Will Palmer <wmpalmer@gmail.com> wrote:
Show 38 quoted lines
> On Tue, 2010-06-29 at 22:29 -0400, Bradley Wagner wrote:
>> I've tried doing git-svn fetch in batches because it takes too long to
>> do it all at once.
>>
>>     git svn -r1:5000 fetch
>>     git svn -r5000:10000 fetch
>>     git svn -r10000:15000 fetch
>>
>> Strangely, after this is done if I look in the history with "git log",
>> I only see commits on master branch up through the 5000th revision of
>> the SVN repository. Someone told me to then call git-svn rebase to fix
>> it. What does "-r" actually do when invoked on consecutive calls to
>> "git-svn fetch" and why does git-svn rebase appear to fix it?
>
> The keyword here is "fetch". "fetch" only retrieves data into the
> remote-tracking branch (often called refs/remotes/git-svn), without
> updating your local branches. "git svn rebase", on the other hand,
> rebases your currently-checked-out branch to be based on the git-svn
> remote ref. (note that "git svn rebase" does a "git svn fetch"
> behind-the-scenes first, and is actually just "git svn fetch" followed
> by a normal "git rebase")
>
> The concepts are the same as if you were using the regular git commands
> "fetch" and "rebase", so the man pages for those may offer some insight.
>
>>
>> I posted this question to Stackoverflow before realizing that this
>> list is a better audience for it:
>> http://stackoverflow.com/questions/3144683/master-branch-missing-revisions-after-sequential-git-svn-fetch-calls
>>
>> Thanks!
>> --
>> To unsubscribe from this list: send the line "unsubscribe git" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
>
>

← back to recent threads