git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Ramkumar Ramachandra <artagnon@gmail.com>
Cc: Git List <git@vger.kernel.org>
Subject: Re: [RFC] Delete current branch
Date: Fri, 19 Jul 2013 15:52:19 -0700	[thread overview]
Message-ID: <7vmwpitb6k.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <7vppuewl6h.fsf@alter.siamese.dyndns.org> (Junio C. Hamano's message of "Fri, 19 Jul 2013 09:48:06 -0700")

Junio C Hamano <gitster@pobox.com> writes:

> Ramkumar Ramachandra <artagnon@gmail.com> writes:
>
>> Junio C Hamano wrote:
>>> Did you know that the general way to spell the branch previously you
>>> were on is "@{-1}" and "checkout -" is an ugly special case that is
>>> possible only because "checkout" does not happen to take a "-" as a
>>> valid argument that means something else (like the more usual "read
>>> from standard input")?
>>
>> I disagree that it is ugly: it's a very commonly used shortcut that I
>> like.
>
> It does not matter if you like it or not ;-).
>
> I do agree that "checkout -" is 100% more pleasing to the eye than
> "checkout @{-1}" from visual "prettyness" point of view.
>
> But there is a very commonly accepted long tradition for "-" to mean
> "read from the standard input", so we cannot reuse it to mean "the
> branch I was previously on" for every command without first making
> sure the command will never want to use "-" for the other common
> purpose.
>
> That limits the context we could use "-" and we cannot consistently
> use it everywhere. I find _that_ ugly from the "design cleanliness"
> point of view.

Having said all that.

d18ba221 (sha1_name: support @{-N} syntax in get_sha1(), 2009-01-17)
was primarily for the follow-up patch 696acf45 (checkout: implement
"-" abbreviation, add docs and tests, 2009-01-17).  Two years after
them, we finally did 4e8115ff (merge: allow "-" as a short-hand for
"previous branch", 2011-04-07).

There is no reason we cannot continue.

As long as the addition is carefully prepared so that we know it
will not conflict (or be confused by users) with possible other uses
of "-", I do not think we would mind "git branch -D -" and other
commands to learn "-" as a synonym for @{-1}.

      parent reply	other threads:[~2013-07-19 22:52 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-19 10:35 Ramkumar Ramachandra
2013-07-19 14:28 ` Andreas Schwab
2013-07-19 14:35   ` Ramkumar Ramachandra
2013-07-19 15:08 ` Junio C Hamano
2013-07-19 15:42   ` Ramkumar Ramachandra
2013-07-19 16:48     ` Junio C Hamano
2013-07-19 16:50       ` Ramkumar Ramachandra
2013-07-19 17:08       ` Taylor Hedberg
2013-07-19 19:15         ` Junio C Hamano
2013-07-19 22:52       ` Junio C Hamano [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7vmwpitb6k.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=artagnon@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this inbox:

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).