Tags named '-'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Heya,
  The functionality of `git checkout -` is very useful, and I am hopeful
that `git merge -` will eventually land, as it matches my workflow well
as well.  However, the porcelain is not entirely consistent about
forbidding '-' as a ref name:

        ~/tmp $ git init
        Initialized empty Git repository in /home/chmrr/tmp/.git/
        ~/tmp (master #) $ git commit --allow-empty -m 'First commit'
        [master (root-commit) b7402ef] First commit
        ~/tmp (master) $ git checkout -b other
        Switched to a new branch 'other'
        ~/tmp (other) $ git checkout -
        Switched to branch 'master'
        ~/tmp (master) $ git checkout -b -
        fatal: git checkout: we do not like '-' as a branch name.
        ~/tmp (master) $ git tag -
        ~/tmp (master) $ git tag -l
        -
        ~/tmp (master) $ git checkout -
        Switched to branch 'other'

The likely best fix is to disallow '-' as a tag name, as well, which
would be handy because the typo of leaving off the 'l' on '-l', for
example, which is not an uncommon mistake that I have seen.
 - Alex

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]