Re: [PATCHv4] clone --single: limit the fetch refspec to fetched branch

2012-09-17 Thread Junio C Hamano
Nguyen Thai Ngoc Duy writes: > On Tue, Sep 18, 2012 at 3:09 AM, Junio C Hamano wrote: >> Nguyen Thai Ngoc Duy writes: >> >>> On Mon, Sep 17, 2012 at 7:06 PM, Nguyen Thai Ngoc Duy >>> wrote: --mirror --single-branch combination does not look right. The "heads/" part is missing.. >>>

Re: [PATCHv4] clone --single: limit the fetch refspec to fetched branch

2012-09-17 Thread Nguyen Thai Ngoc Duy
On Tue, Sep 18, 2012 at 3:09 AM, Junio C Hamano wrote: > Nguyen Thai Ngoc Duy writes: > >> On Mon, Sep 17, 2012 at 7:06 PM, Nguyen Thai Ngoc Duy >> wrote: >>> --mirror --single-branch combination does not look right. The "heads/" >>> part is missing.. >> >> It also does not look right for cloni

Re: [PATCHv4] clone --single: limit the fetch refspec to fetched branch

2012-09-17 Thread Nguyen Thai Ngoc Duy
On Tue, Sep 18, 2012 at 3:08 AM, Junio C Hamano wrote: > Nguyen Thai Ngoc Duy writes: > >> --mirror --single-branch combination does not look right. The "heads/" >> part is missing.. > > What does it supposed to do in the first place? "mirror" is > primarily about grabbing everything without lea

Re: [PATCHv4] clone --single: limit the fetch refspec to fetched branch

2012-09-17 Thread Junio C Hamano
Nguyen Thai Ngoc Duy writes: > On Mon, Sep 17, 2012 at 7:06 PM, Nguyen Thai Ngoc Duy > wrote: >> --mirror --single-branch combination does not look right. The "heads/" >> part is missing.. > > It also does not look right for cloning a tag: > > $ LANG=C ./git clone --single-branch --branch=v1.7.

Re: [PATCHv4] clone --single: limit the fetch refspec to fetched branch

2012-09-17 Thread Junio C Hamano
Nguyen Thai Ngoc Duy writes: > --mirror --single-branch combination does not look right. The "heads/" > part is missing.. What does it supposed to do in the first place? "mirror" is primarily about grabbing everything without leaving stuff out, and "single" is about grabbing only one thing with

Re: [PATCHv4] clone --single: limit the fetch refspec to fetched branch

2012-09-17 Thread Ralf Thielow
On Mon, Sep 17, 2012 at 2:06 PM, Nguyen Thai Ngoc Duy wrote: > On Sun, Sep 16, 2012 at 3:13 PM, Ralf Thielow wrote: >> + if (option_mirror || !option_bare) { >> + strbuf_reset(&value); > > I think we should use a new strbuf local variable here to avoid > resetting this. At lea

Re: [PATCHv4] clone --single: limit the fetch refspec to fetched branch

2012-09-17 Thread Nguyen Thai Ngoc Duy
On Mon, Sep 17, 2012 at 7:06 PM, Nguyen Thai Ngoc Duy wrote: > --mirror --single-branch combination does not look right. The "heads/" > part is missing.. It also does not look right for cloning a tag: $ LANG=C ./git clone --single-branch --branch=v1.7.0 .git abc Cloning into 'abc'... done. Note:

Re: [PATCHv4] clone --single: limit the fetch refspec to fetched branch

2012-09-17 Thread Nguyen Thai Ngoc Duy
On Sun, Sep 16, 2012 at 3:13 PM, Ralf Thielow wrote: > + if (option_mirror || !option_bare) { > + strbuf_reset(&value); I think we should use a new strbuf local variable here to avoid resetting this. At least reviewers don't have to check if this statememt causes any effect la

Re: [PATCHv4] clone --single: limit the fetch refspec to fetched branch

2012-09-16 Thread Junio C Hamano
Ralf Thielow writes: > - add tests for the refspec installed by the clone command Thanks. > +test_expect_success 'refspec contains all branches by default' ' > + git clone "file://$PWD" dir_all && There have been numerous "on windows which should we use, $PWD or $(pwd)?" gotchas. In this

[PATCHv4] clone --single: limit the fetch refspec to fetched branch

2012-09-16 Thread Ralf Thielow
After running "git clone --single", the resulting repository has the usual default "+refs/heads/*:refs/remotes/origin/*" wildcard fetch refspec installed, which means that a subsequent "git fetch" will end up grabbing all the other branches. Update the fetch refspec to cover only the singly cloned