public inbox for git@vger.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Omri Sarig <omri.sarig13@gmail.com>
Cc: Omri Sarig via GitGitGadget <gitgitgadget@gmail.com>,
	 git@vger.kernel.org
Subject: Re: [PATCH v3] doc: add information regarding external commands
Date: Tue, 03 Mar 2026 12:36:19 -0800	[thread overview]
Message-ID: <xmqqy0k8bqgs.fsf@gitster.g> (raw)
In-Reply-To: <CAP9es6uT4xE2+h6mCXgYVcibutVOah1xKyS8cKaV1u=VHBpLZw@mail.gmail.com> (Omri Sarig's message of "Tue, 3 Mar 2026 21:11:13 +0100")

Omri Sarig <omri.sarig13@gmail.com> writes:

>> I am not sure what the last sentence wants to say, especially the
>> "alias expansion" part.  Do you mean that your "git foo" alias (not
>> just its expansion but its presence as a whole) is ignored if you
>> have a "git-foo" program on your $PATH?
>
> This is exactly what I tried to write there.
> Personally, I had expected aliases to take precedence over external commands,
> so I was surprised to see that it is reversed (so the program "git-foo" runs
> before Git looks for the alias "git foo"). I thought it'll make sense to
> mention in the documentation, to save possible headaches for future developers.
>
> I'm not sure it's too much information, or should just be described better?

The latter.

We hear "X takes precedence over Y" more often when we describe the
relationship between commands and aliases.  I do not think we use
verb "X precedes Y" in our documentation to indicate that
relationship.  We do see the verb used for "X comes before Y" in
many places in our documentation, though.

Here is my attempt.

    ... Argument passed after the command name are passed as-is to
    the program.  To execute `git <foo>`, `git` finds command
    `<foo>` (either a core Git program found in 'GIT_EXEC_PATH', or
    a custom one in a directory on 'PATH'), before trying `foo` as
    an alias.

>>  We divide Git into high level ("porcelain") commands and low level
>> -("plumbing") commands.
>> +("plumbing") commands.  For defining command aliases, see
>> +linkgit:gitconfig[1] and look for descriptions of `alias.*`.
>> +For installing custom "git" subcommands, see the description for
>> +the 'PATH' environment variable in this manual.
>>
>>  High-level commands (porcelain)
>>  -------------------------------
>
> I agree - that makes good sense to me too.
>
> Do you see it as belonging in the same commit, or in a subsequent commit?

Totally outside of your topic.  Let's concentrate on the PATH thing
and finish it first.

Thanks.


  reply	other threads:[~2026-03-03 20:36 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-02 19:31 [PATCH] doc: add information regarding external commands Omri Sarig via GitGitGadget
2026-03-02 22:56 ` Junio C Hamano
2026-03-03 17:07   ` Omri Sarig
2026-03-03 17:12 ` [PATCH v2] " Omri Sarig via GitGitGadget
2026-03-03 17:43   ` [PATCH v3] " Omri Sarig via GitGitGadget
2026-03-03 18:40     ` Junio C Hamano
2026-03-03 18:48       ` D. Ben Knoble
2026-03-03 20:11       ` Omri Sarig
2026-03-03 20:36         ` Junio C Hamano [this message]
2026-03-04 15:03     ` [PATCH v4] " Omri Sarig via GitGitGadget

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=xmqqy0k8bqgs.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=omri.sarig13@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox