From: Junio C Hamano <gitster@pobox•com>
To: Stefan Beller <sbeller@google•com>
Cc: "git\@vger.kernel.org" <git@vger•kernel.org>
Subject: Re: Redirect "git" subcommand to itself?
Date: Wed, 27 May 2015 18:53:26 -0700 [thread overview]
Message-ID: <xmqqoal5ii21.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <CAGZ79kZHa9wUrRsWfHgGdSdx+cN9VAirAAfu3YLVTuSmggcehg@mail.gmail.com> (Stefan Beller's message of "Wed, 27 May 2015 17:28:34 -0700")
Stefan Beller <sbeller@google•com> writes:
> so I just run into this problem again (which happens to me maybe twice a week):
> I want to do a git operations, so I type "git " into my shell, and
> then I look around what
> exactly I want to do and usually I find it in the help text of a
> previous command such as
> You are currently reverting commit 383c14b.
> (fix conflicts and run "git revert --continue")
> (use "git revert --abort" to cancel the revert operation)
>
> then I copy the whole operation "git revert --abort" in this case and
> paste it to the shell
> and let go.
> The result looks like
> $ git git revert --abort
> git: 'git' is not a git command. See 'git --help'.
>
> Did you mean this?
> init
>
> I wonder if we want to make a "git" subcommand, which behaves exactly
> the same as git itself?
> Then "git git git status" would just return the same as "git status".
A few unrelated thoughts.
* Perhaps we should omit 'git' from these advice-texts? E.g.
use "revert --abort" to cancel
I dunno.
* While we bend over backwards to a certain degree to be helpful, I
somehow feel making "git git" a synonym to "git" is going too
far, akin to asking POSIX maintainers to define "act", "cta",
"atc", "tca", and "tac" all as synonyms to "cat" because you
often fat-finger when typing "cat" (yes, "tac" does something
else that is more useful, I know).
* You can help yourself with something like this, I suppose:
[alias]
git = "!sh -c 'exec git \"$@\"' -"
but I personally feel that it is too ugly to live as part of our
official suggestion, so please do not send a patch to add it as
a built-in alias ;-).
next prev parent reply other threads:[~2015-05-28 1:53 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-28 0:28 Redirect "git" subcommand to itself? Stefan Beller
2015-05-28 1:53 ` Junio C Hamano [this message]
2015-05-28 5:22 ` Jeff King
2015-05-29 8:38 ` Christian Neukirchen
2015-05-29 13:24 ` Aaron Schrab
2015-05-29 15:38 ` Junio C Hamano
2015-05-29 16:00 ` Stefan Beller
2015-05-29 16:41 ` Christian Neukirchen
2015-05-29 16:49 ` Junio C Hamano
2015-05-28 10:36 ` Konstantin Khomoutov
2015-05-28 13:11 ` Matthieu Moy
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=xmqqoal5ii21.fsf@gitster.dls.corp.google.com \
--to=gitster@pobox$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=sbeller@google$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox