[PATCH] nmbug: Add 'clone' and replace FETCH_HEAD with @{upstream}

2014-03-09 Thread David Bremner
"W. Trevor King" writes: >> >> I think doing a fetch immediately after a clone deserves a comment. > > I commented in the commit message. Basically everything from ?One > tricky bit is that bare repositories don't set upstream tracking > branches by default? down through ?gives us the master-bra

Re: [PATCH] nmbug: Add 'clone' and replace FETCH_HEAD with @{upstream}

2014-03-09 Thread David Bremner
"W. Trevor King" writes: >> >> I think doing a fetch immediately after a clone deserves a comment. > > I commented in the commit message. Basically everything from “One > tricky bit is that bare repositories don't set upstream tracking > branches by default” down through “gives us the master-bra

[PATCH] nmbug: Add 'clone' and replace FETCH_HEAD with @{upstream}

2014-03-08 Thread David Bremner
"W. Trevor King" writes: > +sub do_clone { > + my $repository = shift; > + system ('git', 'clone', '--bare', $repository, $NMBGIT) == 0 > +or die "'git clone' exited with nonzero value\n"; > + my $branch = git ('symbolic-ref', 'HEAD'); > + $branch =~ s|^refs/heads/||; > + git ('config',

Re: [PATCH] nmbug: Add 'clone' and replace FETCH_HEAD with @{upstream}

2014-03-08 Thread W. Trevor King
On Sat, Mar 08, 2014 at 08:26:33AM -0800, W. Trevor King wrote: > That's going to create ~/.nmbug/.git though, if we want to preserve > the current bare-style ~/.nmbug/ layout, we'd need something like: > > $ TEMPDIR=$(mktemp -d) > $ git clone --no-checkout --separate-git-dir=~/.nmbug \ > >

[PATCH] nmbug: Add 'clone' and replace FETCH_HEAD with @{upstream}

2014-03-08 Thread W. Trevor King
On Sat, Mar 08, 2014 at 08:26:33AM -0800, W. Trevor King wrote: > That's going to create ~/.nmbug/.git though, if we want to preserve > the current bare-style ~/.nmbug/ layout, we'd need something like: > > $ TEMPDIR=$(mktemp -d) > $ git clone --no-checkout --separate-git-dir=~/.nmbug \ > >

Re: [PATCH] nmbug: Add 'clone' and replace FETCH_HEAD with @{upstream}

2014-03-08 Thread W. Trevor King
On Sat, Mar 08, 2014 at 08:43:26AM -0400, David Bremner wrote: > W. Trevor King writes: > > +sub do_clone { > > + my $repository = shift; > > + system ('git', 'clone', '--bare', $repository, $NMBGIT) == 0 > > +or die "'git clone' exited with nonzero value\n"; > > + my $branch = git ('symboli

[PATCH] nmbug: Add 'clone' and replace FETCH_HEAD with @{upstream}

2014-03-08 Thread W. Trevor King
On Sat, Mar 08, 2014 at 08:43:26AM -0400, David Bremner wrote: > W. Trevor King writes: > > +sub do_clone { > > + my $repository = shift; > > + system ('git', 'clone', '--bare', $repository, $NMBGIT) == 0 > > +or die "'git clone' exited with nonzero value\n"; > > + my $branch = git ('symboli

Re: [PATCH] nmbug: Add 'clone' and replace FETCH_HEAD with @{upstream}

2014-03-08 Thread David Bremner
"W. Trevor King" writes: > +sub do_clone { > + my $repository = shift; > + system ('git', 'clone', '--bare', $repository, $NMBGIT) == 0 > +or die "'git clone' exited with nonzero value\n"; > + my $branch = git ('symbolic-ref', 'HEAD'); > + $branch =~ s|^refs/heads/||; > + git ('config',

[PATCH] nmbug: Add 'clone' and replace FETCH_HEAD with @{upstream}

2014-02-08 Thread W. Trevor King
From: "W. Trevor King" With two branches getting fetched (master and config), the branch referenced by FETCH_HEAD is ambiguous. For example, I have: $ cat FETCH_HEAD 41d7bfa7184cc93c9dac139d1674e9530799e3b0 \ not-for-merge branch 'config' of http://nmbug.tethera.net/git/nmbug-tags a

[PATCH] nmbug: Add 'clone' and replace FETCH_HEAD with @{upstream}

2014-02-08 Thread W. Trevor King
From: "W. Trevor King" With two branches getting fetched (master and config), the branch referenced by FETCH_HEAD is ambiguous. For example, I have: $ cat FETCH_HEAD 41d7bfa7184cc93c9dac139d1674e9530799e3b0 \ not-for-merge branch 'config' of http://nmbug.tethera.net/git/nmbug-tags a