git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Tags named '-'
@ 2011-05-09 15:21 Alex Vandiver
  2011-05-09 18:01 ` Junio C Hamano
  2011-05-09 22:04 ` Tags named '-' Sverre Rabbelier
  0 siblings, 2 replies; 7+ messages in thread
From: Alex Vandiver @ 2011-05-09 15:21 UTC (permalink / raw)
  To: git

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-05-10  9:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-09 15:21 Tags named '-' Alex Vandiver
2011-05-09 18:01 ` Junio C Hamano
2011-05-09 22:56   ` [RFC/PATCH] tag: disallow '-' as tag name Michael Schubert
2011-05-09 23:08     ` Junio C Hamano
2011-05-09 23:36       ` [RFC/PATCH v2] " Michael Schubert
     [not found]         ` <BANLkTik7PYjGMMfxaNPubYR7M1OgBrF_qw@mail.gmail.com>
2011-05-10  9:47           ` Michael Schubert
2011-05-09 22:04 ` Tags named '-' Sverre Rabbelier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).