threads / discuss / 18618

git-svn stubbornly re-creating branch "master"

Subject: git-svn stubbornly re-creating branch "master"

## tl;dr

10 messages between Mar 29, 2009 and Jun 14, 2009.

replies: 9people: 7as markdown or json

Marcin Owsiany· Mar 29, 2009, 17:13 UTC · lore
Hello,

I created my git repository by cloning it with git-svn from an upstream SVN repository. When I did that, a branch "master" was created. Afterwards I renamed that branch to "upstream". However every time I "git-svn fetch", it recreates the "master" branch, pointing it at the newest upstream commit.

Ideally, I'd like it to just forget about "master" and do the same to my "upstream" branch. Is it possible?

If not, then is it at least possible to have it not recreate the "master" branch? It clutters my view.

Here's a typescript (with git 1:1.5.6.3-1.1ubuntu2):
$ svnadmin create svn-repo
$ r=`pwd`/svn-repo
$ svn co file://$r svn
Checked out revision 0.
$ (cd svn && echo one >> file && svn add file && svn ci -m one file)
A         file
Adding         file
Transmitting file data .
Committed revision 1.
$ git-svn clone file://$r git
Initialized empty Git repository in /home/mowsiany/tmp/gs/git/.git/
        A       file
r1 = 66e7199fe089b1e626efb5f2f3106189d992d288 (git-svn)
Checked out HEAD:
  file:///home/mowsiany/tmp/gs/svn-repo r1
$ (cd git && git show-ref )
66e7199fe089b1e626efb5f2f3106189d992d288 refs/heads/master
66e7199fe089b1e626efb5f2f3106189d992d288 refs/remotes/git-svn
$ (cd git && git branch mystuff )
$ (cd git && git show-ref )
66e7199fe089b1e626efb5f2f3106189d992d288 refs/heads/master
66e7199fe089b1e626efb5f2f3106189d992d288 refs/heads/mystuff
66e7199fe089b1e626efb5f2f3106189d992d288 refs/remotes/git-svn
$ (cd git && git branch -m master upstream )
$ (cd git && git show-ref )
66e7199fe089b1e626efb5f2f3106189d992d288 refs/heads/mystuff
66e7199fe089b1e626efb5f2f3106189d992d288 refs/heads/upstream
66e7199fe089b1e626efb5f2f3106189d992d288 refs/remotes/git-svn
$ (cd svn && echo two >> file  && svn ci -m two file)
Sending        file
Transmitting file data .
Committed revision 2.
$ (cd git && git-svn fetch  )
        M       file
r2 = c2f8e7fd146e0e9f1223f20bf3c2105f71632c4b (git-svn)
$ (cd git && git show-ref )
c2f8e7fd146e0e9f1223f20bf3c2105f71632c4b refs/heads/master
66e7199fe089b1e626efb5f2f3106189d992d288 refs/heads/mystuff
66e7199fe089b1e626efb5f2f3106189d992d288 refs/heads/upstream
c2f8e7fd146e0e9f1223f20bf3c2105f71632c4b refs/remotes/git-svn
As you can see, "master" sprang back to life after the last command.
-- 
Marcin Owsiany <porridge@debian.org>             http://marcin.owsiany.pl/
GnuPG: 1024D/60F41216  FE67 DA2D 0ACA FC5E 3F75  D6F6 3A0D 8AA0 60F4 1216
Dmitry Potapov· Mar 29, 2009, 19:52 UTC · re: Marcin Owsiany · lore

Re: git-svn stubbornly re-creating branch "master"

On Sun, Mar 29, 2009 at 18:13:47 +0100, Marcin Owsiany <porridge@debian.org> wrote:

>
> As you can see, "master" sprang back to life after the last command.

It looks like git-svn does not like a repo without 'master'. It seems the problem was caused by this patch: http://git.kernel.org/?p=git/git.git;a=commit;h=1e889ef36c45b5554f7e317493ed3f4f901f8d9f

I have added Eric to CC...
Dmitry
Mikael Magnusson· Apr 3, 2009, 10:57 UTC · re: Dmitry Potapov · lore

Re: git-svn stubbornly re-creating branch "master"

2009/3/29 Dmitry Potapov <dpotapov@gmail.com>:
Show 10 quoted lines
> On Sun, Mar 29, 2009 at 18:13:47 +0100, Marcin Owsiany
> <porridge@debian.org> wrote:
>>
>> As you can see, "master" sprang back to life after the last command.
>
> It looks like git-svn does not like a repo without 'master'. It seems
> the problem was caused by this patch:
> http://git.kernel.org/?p=git/git.git;a=commit;h=1e889ef36c45b5554f7e317493ed3f4f901f8d9f
>
> I have added Eric to CC...

Why not just check if HEAD points to a valid commit, rather than master? It should do the same in the newly created repo case, and stop annoying people on updates.

-- 
Mikael Magnusson
Marcin Owsiany· Jun 6, 2009, 10:55 UTC · re: Mikael Magnusson · lore

Re: git-svn stubbornly re-creating branch "master"

This discussion seems to have stalled...
On Fri, Apr 03, 2009 at 12:57:52PM +0200, Mikael Magnusson wrote:
Show 15 quoted lines
> 2009/3/29 Dmitry Potapov <dpotapov@gmail.com>:
> > On Sun, Mar 29, 2009 at 18:13:47 +0100, Marcin Owsiany
> > <porridge@debian.org> wrote:
> >>
> >> As you can see, "master" sprang back to life after the last command.
> >
> > It looks like git-svn does not like a repo without 'master'. It seems
> > the problem was caused by this patch:
> > http://git.kernel.org/?p=git/git.git;a=commit;h=1e889ef36c45b5554f7e317493ed3f4f901f8d9f
> >
> > I have added Eric to CC...
> 
> Why not just check if HEAD points to a valid commit, rather than
> master? It should do the same
> in the newly created repo case, and stop annoying people on updates.

There seems to be agreement that while conventions are nice, git should not force branch names on people. Can someone implement Mikael's suggestion?

-- 
Marcin Owsiany <marcin@owsiany.pl>              http://marcin.owsiany.pl/
GnuPG: 1024D/60F41216  FE67 DA2D 0ACA FC5E 3F75  D6F6 3A0D 8AA0 60F4 1216
 
"Every program in development at MIT expands until it can read mail."
                                                              -- Unknown
Marcin Owsiany· Jun 14, 2009, 15:52 UTC · re: Marcin Owsiany · lore

Re: git-svn stubbornly re-creating branch "master"

On Sat, Jun 06, 2009 at 11:55:01AM +0100, Marcin Owsiany wrote:
Show 22 quoted lines
> This discussion seems to have stalled...
> 
> On Fri, Apr 03, 2009 at 12:57:52PM +0200, Mikael Magnusson wrote:
> > 2009/3/29 Dmitry Potapov <dpotapov@gmail.com>:
> > > On Sun, Mar 29, 2009 at 18:13:47 +0100, Marcin Owsiany
> > > <porridge@debian.org> wrote:
> > >>
> > >> As you can see, "master" sprang back to life after the last command.
> > >
> > > It looks like git-svn does not like a repo without 'master'. It seems
> > > the problem was caused by this patch:
> > > http://git.kernel.org/?p=git/git.git;a=commit;h=1e889ef36c45b5554f7e317493ed3f4f901f8d9f
> > >
> > > I have added Eric to CC...
> > 
> > Why not just check if HEAD points to a valid commit, rather than
> > master? It should do the same
> > in the newly created repo case, and stop annoying people on updates.
> 
> There seems to be agreement that while conventions are nice, git should
> not force branch names on people. Can someone implement Mikael's
> suggestion?
[silence]

OK, a different question, then: if I wrote a patch to implement the behaviour described by Mikael, would you consider including it?

-- 
Marcin Owsiany <marcin@owsiany.pl>              http://marcin.owsiany.pl/
GnuPG: 1024D/60F41216  FE67 DA2D 0ACA FC5E 3F75  D6F6 3A0D 8AA0 60F4 1216
 
"Every program in development at MIT expands until it can read mail."
                                                              -- Unknown
Andreas Ericsson· Jun 14, 2009, 17:33 UTC · re: Marcin Owsiany · lore

Re: git-svn stubbornly re-creating branch "master"

Marcin Owsiany wrote:
Show 25 quoted lines
> On Sat, Jun 06, 2009 at 11:55:01AM +0100, Marcin Owsiany wrote:
>> This discussion seems to have stalled...
>>
>> On Fri, Apr 03, 2009 at 12:57:52PM +0200, Mikael Magnusson wrote:
>>> 2009/3/29 Dmitry Potapov <dpotapov@gmail.com>:
>>>> On Sun, Mar 29, 2009 at 18:13:47 +0100, Marcin Owsiany
>>>> <porridge@debian.org> wrote:
>>>>> As you can see, "master" sprang back to life after the last command.
>>>> It looks like git-svn does not like a repo without 'master'. It seems
>>>> the problem was caused by this patch:
>>>> http://git.kernel.org/?p=git/git.git;a=commit;h=1e889ef36c45b5554f7e317493ed3f4f901f8d9f
>>>>
>>>> I have added Eric to CC...
>>> Why not just check if HEAD points to a valid commit, rather than
>>> master? It should do the same
>>> in the newly created repo case, and stop annoying people on updates.
>> There seems to be agreement that while conventions are nice, git should
>> not force branch names on people. Can someone implement Mikael's
>> suggestion?
> 
> [silence]
> 
> OK, a different question, then: if I wrote a patch to implement the
> behaviour described by Mikael, would you consider including it?
> 

Patches are always considered, but asking about inclusion before the code is written doesn't really work. If you care about this feature and really want it, you should write the patch and submit it to the mailing list for discussion. It might get dropped on the floor or it might get accepted, but without you actually showing that you want it, nothing at all will happen.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.
Marcin Owsiany· Jun 14, 2009, 21:16 UTC · re: Andreas Ericsson · lore

Re: git-svn stubbornly re-creating branch "master"

On Sun, Jun 14, 2009 at 07:33:58PM +0200, Andreas Ericsson wrote:
Show 33 quoted lines
> Marcin Owsiany wrote:
>> On Sat, Jun 06, 2009 at 11:55:01AM +0100, Marcin Owsiany wrote:
>>> This discussion seems to have stalled...
>>>
>>> On Fri, Apr 03, 2009 at 12:57:52PM +0200, Mikael Magnusson wrote:
>>>> 2009/3/29 Dmitry Potapov <dpotapov@gmail.com>:
>>>>> On Sun, Mar 29, 2009 at 18:13:47 +0100, Marcin Owsiany
>>>>> <porridge@debian.org> wrote:
>>>>>> As you can see, "master" sprang back to life after the last command.
>>>>> It looks like git-svn does not like a repo without 'master'. It seems
>>>>> the problem was caused by this patch:
>>>>> http://git.kernel.org/?p=git/git.git;a=commit;h=1e889ef36c45b5554f7e317493ed3f4f901f8d9f
>>>>>
>>>>> I have added Eric to CC...
>>>> Why not just check if HEAD points to a valid commit, rather than
>>>> master? It should do the same
>>>> in the newly created repo case, and stop annoying people on updates.
>>> There seems to be agreement that while conventions are nice, git should
>>> not force branch names on people. Can someone implement Mikael's
>>> suggestion?
>>
>> [silence]
>>
>> OK, a different question, then: if I wrote a patch to implement the
>> behaviour described by Mikael, would you consider including it?
>>
>
> Patches are always considered, but asking about inclusion before the
> code is written doesn't really work. If you care about this feature
> and really want it, you should write the patch and submit it to the
> mailing list for discussion. It might get dropped on the floor or it
> might get accepted, but without you actually showing that you want
> it, nothing at all will happen.

Yes, I understand that. I was more looking for some guidance on whether working in that direction makes sense. I'm still a git newbie :-)

-- 
Marcin Owsiany <marcin@owsiany.pl>              http://marcin.owsiany.pl/
GnuPG: 1024D/60F41216  FE67 DA2D 0ACA FC5E 3F75  D6F6 3A0D 8AA0 60F4 1216
 
"Every program in development at MIT expands until it can read mail."
                                                              -- Unknown
Eric Wong· Mar 29, 2009, 22:28 UTC · re: Marcin Owsiany · lore

Re: git-svn stubbornly re-creating branch "master"

Marcin Owsiany <porridge@debian.org> wrote:
Show 12 quoted lines
> Hello,
> 
> I created my git repository by cloning it with git-svn from an upstream SVN
> repository. When I did that, a branch "master" was created. Afterwards I
> renamed that branch to "upstream". However every time I "git-svn fetch", it
> recreates the "master" branch, pointing it at the newest upstream commit.
> 
> Ideally, I'd like it to just forget about "master" and do the same to my
> "upstream" branch. Is it possible?
> 
> If not, then is it at least possible to have it not recreate the "master"
> branch? It clutters my view.

"master" has been a git convention since the earliest days of git and it's less confusing to new users following documentation if it always exists (and a lot of users' first git experience is with git svn).

Why not just use "master" as one of your branches? It won't bite you. "git svn fetch" will never clobber your "master" if it already exists.

-- 
Eric Wong
David Kågedal· Apr 3, 2009, 10:42 UTC · re: Eric Wong · lore

Re: git-svn stubbornly re-creating branch "master"

Eric Wong <normalperson@yhbt.net> writes:
Show 20 quoted lines
> Marcin Owsiany <porridge@debian.org> wrote:
>> Hello,
>> 
>> I created my git repository by cloning it with git-svn from an upstream SVN
>> repository. When I did that, a branch "master" was created. Afterwards I
>> renamed that branch to "upstream". However every time I "git-svn fetch", it
>> recreates the "master" branch, pointing it at the newest upstream commit.
>> 
>> Ideally, I'd like it to just forget about "master" and do the same to my
>> "upstream" branch. Is it possible?
>> 
>> If not, then is it at least possible to have it not recreate the "master"
>> branch? It clutters my view.
>
> "master" has been a git convention since the earliest days of git and
> it's less confusing to new users following documentation if it always
> exists (and a lot of users' first git experience is with git svn).
>
> Why not just use "master" as one of your branches?  It won't bite you.
> "git svn fetch" will never clobber your "master" if it already exists.

I also find this highly annoying. I use branch names that matches the branches we use in svn. So when working on changes for the svn "foo" branch, I have a git branch "foo" that is based on "svn/foo". And when working on "bar" I use a "bar" branch and so on. A "master" branch has no place in my workflow, and I keep deleteing it over and over again.

But mostly I just ignore it.
-- 
David Kågedal
Marcin Owsiany· Apr 3, 2009, 12:26 UTC · re: Eric Wong · lore

Re: git-svn stubbornly re-creating branch "master"

On Sun, Mar 29, 2009 at 03:28:27PM -0700, Eric Wong wrote:
> Why not just use "master" as one of your branches?  It won't bite you.

It's because I have two main branches in my repository, and none of them is really more important ATM. I prefer to use different names.

-- 
Marcin Owsiany <marcin@owsiany.pl>              http://marcin.owsiany.pl/
GnuPG: 1024D/60F41216  FE67 DA2D 0ACA FC5E 3F75  D6F6 3A0D 8AA0 60F4 1216
 
"Every program in development at MIT expands until it can read mail."
                                                              -- Unknown

← back to recent threads