From: Michael J Gruber <git@drmicha.warpmail.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Thomas Adam <thomas@xteddy.org>, git@vger.kernel.org
Subject: Re: [PATCH] merge: allow "-" as a short-hand for "previous branch"
Date: Fri, 08 Apr 2011 11:30:20 +0200 [thread overview]
Message-ID: <4D9ED5AC.3050106@drmicha.warpmail.net> (raw)
In-Reply-To: <7vbp0h63sw.fsf@alter.siamese.dyndns.org>
Junio C Hamano venit, vidit, dixit 08.04.2011 01:26:
> Thomas Adam <thomas@xteddy.org> writes:
>
>> I agree this is is useful, but is there a danger of this being a
>> common typo, and people merging in previous branches a lot more often
>> than they ever intended? In the case of "git checkout -" that's not
>> as fatal, but if I ever mistype "git merge -" -- I'm now left with an
>> unraveling exercise to do.
>
> Just like you can checkout the previous branch back if you found you
> checked out a wrong branch by a typo, if you found that you merged a wrong
> branch, you can just reset it away back to ORIG_HEAD, no?
>
> Or am I missing something more obvious?
Only tests and doc :)
Seriously, I like that. If there are more places where this makes sense
(I haven't looked) we might even factor it out. In principle it makes
sense everywhere where a branch name makes sense, e.g.:
git branch -D foo
#...can't delete the current branch
git checkout whatever
git branch -D -
In this case, shell history is faster, of course.
Michael
next prev parent reply other threads:[~2011-04-08 9:30 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-07 23:03 [PATCH] merge: allow "-" as a short-hand for "previous branch" Junio C Hamano
2011-04-07 23:13 ` Thomas Adam
2011-04-07 23:26 ` Junio C Hamano
2011-04-08 9:30 ` Michael J Gruber [this message]
2011-04-08 18:43 ` Junio C Hamano
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=4D9ED5AC.3050106@drmicha.warpmail.net \
--to=git@drmicha.warpmail.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=thomas@xteddy.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 public 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).