git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git-svn, remote tracking branch question
@ 2007-03-27 20:26 Seth Falcon
  2007-03-27 22:00 ` Eric Wong
  0 siblings, 1 reply; 5+ messages in thread
From: Seth Falcon @ 2007-03-27 20:26 UTC (permalink / raw)
  To: git; +Cc: Eric Wong

Hi,

I've edited my <repos>/.git/config file so that git-svn is tracking
the main devel line as well as a release branch of a project.  This
seems to work well.

So I have:

[svn-remote "svn"]
	url = https://svn.url.com/root
	fetch = branches/release-2-5:refs/remotes/2.5
	fetch = trunk:refs/remotes/git-svn

I can checkout the 2.5 release branch like this:

   git checkout -b 2.5 remotes/2.5

But at this point, how do I ask git-svn to update it?  When working on
the devel line, I can do 'git svn rebase' and I would like to do the
same thing but relative to the branch.

Perhaps there is some config I can add so that I don't have to do:

   git svn fetch
   git rebase remotes/2.5

That isn't so bad except for having to remember where you are...

Thanks,

+ seth

-- 
Seth Falcon

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: git-svn, remote tracking branch question
  2007-03-27 20:26 git-svn, remote tracking branch question Seth Falcon
@ 2007-03-27 22:00 ` Eric Wong
  2007-03-28 15:24   ` Seth Falcon
  2007-03-29 20:58   ` Eric Wong
  0 siblings, 2 replies; 5+ messages in thread
From: Eric Wong @ 2007-03-27 22:00 UTC (permalink / raw)
  To: Seth Falcon; +Cc: git

Seth Falcon <sethfalcon@gmail.com> wrote:
> Hi,
> 
> I've edited my <repos>/.git/config file so that git-svn is tracking
> the main devel line as well as a release branch of a project.  This
> seems to work well.
> 
> So I have:
> 
> [svn-remote "svn"]
> 	url = https://svn.url.com/root
> 	fetch = branches/release-2-5:refs/remotes/2.5
> 	fetch = trunk:refs/remotes/git-svn
> 
> I can checkout the 2.5 release branch like this:
> 
>    git checkout -b 2.5 remotes/2.5
> 
> But at this point, how do I ask git-svn to update it?  When working on
> the devel line, I can do 'git svn rebase' and I would like to do the
> same thing but relative to the branch.
> 
> Perhaps there is some config I can add so that I don't have to do:
> 
>    git svn fetch
>    git rebase remotes/2.5
> 
> That isn't so bad except for having to remember where you are...

'git svn rebase' should be capable auto-discovering the remote ref that
you last branched from.  I'm not sure if the '2.5' that's common in the
remote ref and your local branch would cause ambiguity, however...

I'll look into this more when/if I have time tonight.

-- 
Eric Wong

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: git-svn, remote tracking branch question
  2007-03-27 22:00 ` Eric Wong
@ 2007-03-28 15:24   ` Seth Falcon
  2007-03-29 20:58   ` Eric Wong
  1 sibling, 0 replies; 5+ messages in thread
From: Seth Falcon @ 2007-03-28 15:24 UTC (permalink / raw)
  To: Eric Wong; +Cc: git

Eric Wong <normalperson@yhbt.net> writes:
> 'git svn rebase' should be capable auto-discovering the remote ref that
> you last branched from.  I'm not sure if the '2.5' that's common in the
> remote ref and your local branch would cause ambiguity, however...
>
> I'll look into this more when/if I have time tonight.

ok.  In the meantime, I renamed my branch to avoid any potential name
conflict and it seems to be working automagically as you described.
That's really useful, thanks.

+ seth

-- 
Seth Falcon

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: git-svn, remote tracking branch question
  2007-03-27 22:00 ` Eric Wong
  2007-03-28 15:24   ` Seth Falcon
@ 2007-03-29 20:58   ` Eric Wong
  2007-03-31  0:32     ` Eric Wong
  1 sibling, 1 reply; 5+ messages in thread
From: Eric Wong @ 2007-03-29 20:58 UTC (permalink / raw)
  To: Seth Falcon; +Cc: git

Eric Wong <normalperson@yhbt.net> wrote:
> I'll look into this more when/if I have time tonight.

Sorry, I tried to look into it this morning at 1-2am but wasn't
successful in reproducing it.  I'm glad the workaround I provided
worked, but I'll take another stab at solving the problem tonight
or this weekend.

-- 
Eric Wong

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: git-svn, remote tracking branch question
  2007-03-29 20:58   ` Eric Wong
@ 2007-03-31  0:32     ` Eric Wong
  0 siblings, 0 replies; 5+ messages in thread
From: Eric Wong @ 2007-03-31  0:32 UTC (permalink / raw)
  To: Seth Falcon; +Cc: git

Eric Wong <normalperson@yhbt.net> wrote:
> Eric Wong <normalperson@yhbt.net> wrote:
> > I'll look into this more when/if I have time tonight.
> 
> Sorry, I tried to look into it this morning at 1-2am but wasn't
> successful in reproducing it.  I'm glad the workaround I provided
> worked, but I'll take another stab at solving the problem tonight
> or this weekend.

Alright, I'm still unable to figure it out.  Here's a patch
that should at least cause it to error out and tell you
which URL it was trying to lookup.

>From 4bf0314f4665b612cbd735fdfae45f84c1e21c04 Mon Sep 17 00:00:00 2001
From: Eric Wong <normalperson@yhbt.net>
Date: Fri, 30 Mar 2007 17:30:30 -0700
Subject: [PATCH] git-svn: fail on rebase if we are unable to find a ref to rebase against

If we're on an invalid HEAD, we should detect this and avoid
attempting to continue.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
 git-svn.perl |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/git-svn.perl b/git-svn.perl
index e0a48c2..adc976c 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -435,6 +435,9 @@ sub cmd_rebase {
 	}
 
 	my $gs = Git::SVN->find_by_url($url);
+	unless ($gs) {
+		die "Unable to determine remote information from URL: $url\n";
+	}
 	if (command(qw/diff-index HEAD --/)) {
 		print STDERR "Cannot rebase with uncommited changes:\n";
 		command_noisy('status');
-- 
Eric Wong

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-03-31  0:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-27 20:26 git-svn, remote tracking branch question Seth Falcon
2007-03-27 22:00 ` Eric Wong
2007-03-28 15:24   ` Seth Falcon
2007-03-29 20:58   ` Eric Wong
2007-03-31  0:32     ` Eric Wong

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).