# git-svn stubbornly re-creating branch "master"

10 messages from 2009-03-29 to 2009-06-14. Participants: Marcin Owsiany, Dmitry Potapov, Eric Wong, David Kågedal, Mikael Magnusson, Andreas Ericsson.
Thread: https://gitlist.dev/t/18618

## Marcin Owsiany, 2009-03-29 17:13

Subject: git-svn stubbornly re-creating branch "master"
Message-ID: <20090329171347.GA26866@beczulka>
URL: https://gitlist.dev/e/20090329171347.GA26866%40beczulka

```
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, 2009-03-29 19:52

Subject: Re: git-svn stubbornly re-creating branch "master"
Message-ID: <37fcd2780903291252i19bba8ccx9dfb73e763d95b15@mail.gmail.com>
URL: https://gitlist.dev/e/37fcd2780903291252i19bba8ccx9dfb73e763d95b15%40mail.gmail.com
In-Reply-To: <20090329171347.GA26866@beczulka>

```
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

```

## Eric Wong, 2009-03-29 22:28

Subject: Re: git-svn stubbornly re-creating branch "master"
Message-ID: <20090329222827.GA32199@dcvr.yhbt.net>
URL: https://gitlist.dev/e/20090329222827.GA32199%40dcvr.yhbt.net
In-Reply-To: <20090329171347.GA26866@beczulka>

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

-- 
Eric Wong

```

## David Kågedal, 2009-04-03 10:42

Subject: Re: git-svn stubbornly re-creating branch "master"
Message-ID: <87eiwakohw.fsf@krank.kagedal.org>
URL: https://gitlist.dev/e/87eiwakohw.fsf%40krank.kagedal.org
In-Reply-To: <20090329222827.GA32199@dcvr.yhbt.net>

```
Eric Wong <normalperson@yhbt.net> writes:

> 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

```

## Mikael Magnusson, 2009-04-03 10:57

Subject: Re: git-svn stubbornly re-creating branch "master"
Message-ID: <237967ef0904030357u15ef77f2rb3299b6f6c651404@mail.gmail.com>
URL: https://gitlist.dev/e/237967ef0904030357u15ef77f2rb3299b6f6c651404%40mail.gmail.com
In-Reply-To: <37fcd2780903291252i19bba8ccx9dfb73e763d95b15@mail.gmail.com>

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

-- 
Mikael Magnusson

```

## Marcin Owsiany, 2009-04-03 12:26

Subject: Re: git-svn stubbornly re-creating branch "master"
Message-ID: <20090403122631.GA23635@beczulka>
URL: https://gitlist.dev/e/20090403122631.GA23635%40beczulka
In-Reply-To: <20090329222827.GA32199@dcvr.yhbt.net>

```
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

```

## Marcin Owsiany, 2009-06-06 10:55

Subject: Re: git-svn stubbornly re-creating branch "master"
Message-ID: <20090606105501.GA29758@beczulka>
URL: https://gitlist.dev/e/20090606105501.GA29758%40beczulka
In-Reply-To: <237967ef0904030357u15ef77f2rb3299b6f6c651404@mail.gmail.com>

```
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?

-- 
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, 2009-06-14 15:52

Subject: Re: git-svn stubbornly re-creating branch "master"
Message-ID: <20090614155205.GC11730@beczulka>
URL: https://gitlist.dev/e/20090614155205.GC11730%40beczulka
In-Reply-To: <20090606105501.GA29758@beczulka>

```
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?

-- 
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, 2009-06-14 17:33

Subject: Re: git-svn stubbornly re-creating branch "master"
Message-ID: <4A353486.2060900@op5.se>
URL: https://gitlist.dev/e/4A353486.2060900%40op5.se
In-Reply-To: <20090614155205.GC11730@beczulka>

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

-- 
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, 2009-06-14 21:16

Subject: Re: git-svn stubbornly re-creating branch "master"
Message-ID: <20090614211616.GA29742@beczulka>
URL: https://gitlist.dev/e/20090614211616.GA29742%40beczulka
In-Reply-To: <4A353486.2060900@op5.se>

```
On Sun, Jun 14, 2009 at 07:33:58PM +0200, Andreas Ericsson wrote:
> 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

```
