Package: git
Version: 1:2.1.3-1
Tags: upstream
Severity: wishlist

A little known feature of 'git clone -b' is that its argument doesn't
need to be a branch name:

        $ git clone -b v2.1.3 --depth=1 
https://kernel.googlesource.com/pub/scm/git/git 
        Cloning into 'git'...
        remote: Sending approximately 57.46 MiB ...
        remote: Counting objects: 2797, done
        remote: Finding sources: 100% (2797/2797)
        remote: Total 2797 (delta 241), reused 1264 (delta 241)
        Receiving objects: 100% (2797/2797), 5.43 MiB | 4.31 MiB/s, done.
        Resolving deltas: 100% (241/241), done.
        Checking connectivity... done.
        Note: checking out '49c3e926349e964b311b46251bb2b97d3d669855'.

        You are in 'detached HEAD' state. [...]

Alas, the syntax after "-b" is not as permissive as what "git fetch"
accepts:

        $ git clone -b refs/tags/v2.1.3 --depth=1 
https://kernel.googlesource.com/pub/scm/git/git 
        Cloning into 'git'...
        warning: Could not find remote branch refs/tags/v2.1.3 to clone.
        fatal: Remote branch refs/tags/v2.1.3 not found in upstream origin

In particular, while 'git fetch' has accepted a SHA-1 to mean "fetch this 
commit,
and I don't care what branch it's on" ever since v1.8.3-rc0~206^2 (2013-01-29),
'git clone -b' does not.  It would be helpful to.

        $ git clone -b 49c3e926349e964b311b46251bb2b97d3d669855 --depth=1 
https://kernel.googlesource.com/pub/scm/git/git 
        Cloning into 'git'...
        warning: Could not find remote branch 
49c3e926349e964b311b46251bb2b97d3d669855 to clone.
        fatal: Remote branch 49c3e926349e964b311b46251bb2b97d3d669855 not found 
in upstream origin


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to