Re: [PATCHv4] clone --single: limit the fetch refspec to fetched branch
- From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
- Date
- Sep 18, 2012, 01:04 UTC
- Message-ID
- <CACsJy8CUuPPvTMNmtX9P5ZHkvUHCVZkKmPj7Ghubxt_daPaKZg@mail.gmail.com>
- In-Reply-To
- <7vd31kv2ba.fsf@alter.siamese.dyndns.org>
On Tue, Sep 18, 2012 at 3:09 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 13 quoted lines
> Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes: > >> On Mon, Sep 17, 2012 at 7:06 PM, Nguyen Thai Ngoc Duy <pclouds@gmail.com> 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 > > What does it even _mean_ to clone a single branch and give a tag, > not a branch, to the --branch option? Again, shouldn't it be > diagnosed as an error in the first place?
That could be misleading. The original purpose is to clone just one ref, be it a branch or a tag. You might want to work on top of a specific version and may not want to clone everything. For cloning a tag, we're put in detached head state immediately.
-- Duy