All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
To: Siddharth Kannan <kannan.siddharth12@gmail.com>
Cc: Junio C Hamano <gitster@pobox.com>,
	Git List <git@vger.kernel.org>,
	Pranit Bauva <pranit.bauva@gmail.com>, Jeff King <peff@peff.net>,
	pclouds@gmail.com,
	"brian m. carlson" <sandals@crustytoothpaste.ath.cx>
Subject: Re: [PATCH/RFC] WIP: log: allow "-" as a short-hand for "previous branch"
Date: Thu, 09 Feb 2017 13:25:54 +0100	[thread overview]
Message-ID: <vpqwpczlfe5.fsf@anie.imag.fr> (raw)
In-Reply-To: <CAN-3QhoZN_wYvqbVdU_c1h4vUOaT5FOBFL7k+FemNpqkxjWDDA@mail.gmail.com> (Siddharth Kannan's message of "Wed, 8 Feb 2017 22:53:05 +0530")

Siddharth Kannan <kannan.siddharth12@gmail.com> writes:

> Hello Matthieu,
>
> On 8 February 2017 at 20:10, Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> wrote:
>> In a previous discussion, I made an analogy with "cd -" (which is the
>> source of inspiration of this shorthand AFAIK): "-" did not magically
>> become "the last visited directory" for all Unix commands, just for
>> "cd". And in this case, I'm happy with it. For example, I never need
>> "mkdir -", and I'm happy I can't "rm -fr -" by mistake.
>>
>> So, it's debatable whether it's a good thing to have all commands
>> support "-". For example, forcing users to explicitly type "git branch
>> -d @{1}" and not providing them with a shortcut might be a good thing.
>
> builtin/branch.c does not call setup_revisions and remains unaffected
> by this patch :)

Right, I forgot this: in some place we need any revspec, but "branch -d"
needs a branch name explicitly.

> [...]
> As you might notice, in this list, most commands are not of the `rm` variety,
> i.e. something that would delete stuff.

OK, I think I'm convinced.

Keep the arguments in mind when polishing the commit message.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

  reply	other threads:[~2017-02-09 14:23 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-05 12:57 [PATCH/RFC] WIP: log: allow "-" as a short-hand for "previous branch" Siddharth Kannan
2017-02-05 14:55 ` Pranit Bauva
2017-02-06  0:15 ` Junio C Hamano
2017-02-06  2:27   ` Siddharth Kannan
2017-02-06 18:10   ` Siddharth Kannan
2017-02-06 23:09     ` Junio C Hamano
2017-02-07 19:14       ` Siddharth Kannan
2017-02-08 14:40         ` Matthieu Moy
2017-02-08 17:23           ` Siddharth Kannan
2017-02-09 12:25             ` Matthieu Moy [this message]
2017-02-09 18:21               ` Siddharth Kannan

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

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

  git send-email \
    --in-reply-to=vpqwpczlfe5.fsf@anie.imag.fr \
    --to=matthieu.moy@grenoble-inp.fr \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=kannan.siddharth12@gmail.com \
    --cc=pclouds@gmail.com \
    --cc=peff@peff.net \
    --cc=pranit.bauva@gmail.com \
    --cc=sandals@crustytoothpaste.ath.cx \
    /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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.