public inbox for git@vger.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Omri Sarig via GitGitGadget" <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org,  Omri Sarig <omri.sarig13@gmail.com>
Subject: Re: [PATCH v3] doc: add information regarding external commands
Date: Tue, 03 Mar 2026 10:40:22 -0800	[thread overview]
Message-ID: <xmqqh5qwdaeh.fsf@gitster.g> (raw)
In-Reply-To: <pull.2220.v3.git.git.1772559813151.gitgitgadget@gmail.com> (Omri Sarig via GitGitGadget's message of "Tue, 03 Mar 2026 17:43:33 +0000")

"Omri Sarig via GitGitGadget" <gitgitgadget@gmail.com> writes:

Thanks.  Almost there.

The usual way to compose a log message of this project is to

 - Give an observation on how the current system works in the
   present tense (so no need to say "Currently X is Y", or
   "Previously X was Y" to describe the state before your change;
   just "X is Y" is enough), and discuss what you perceive as a
   problem in it.

 - Propose a solution (optional---often, problem description
   trivially leads to an obvious solution in reader's minds).

 - Give commands to somebody editing the codebase to "make it so",
   instead of saying "This commit does X".

in this order.

> From: Omri Sarig <omri.sarig13@gmail.com>
>
> Git supports running external commands in the user's PATH as if they
> were built-in commands (see execv_dashed_external in git.c).
>
> This feature was not fully documented in Git's user-facing
> documentation.

Your description of the problem above is excellent.

> This commit adds a short documentation of this feature, making it easier
> for users to discover and use.

There is nothing incorrect in the above, but we would write it more
like

    Add a short documentation to describe how PATH is used to find a
    custom subcommand.

> Signed-off-by: Omri Sarig <omri.sarig13@gmail.com>

> diff --git a/Documentation/git.adoc b/Documentation/git.adoc
> index ce099e78b8..903d11c530 100644
> --- a/Documentation/git.adoc
> +++ b/Documentation/git.adoc
> @@ -487,6 +487,13 @@ System
>  	`$HOMEDRIVE$HOMEPATH` if both `$HOMEDRIVE` and `$HOMEPATH` exist;
>  	otherwise `$USERPROFILE` if `$USERPROFILE` exists.
>  
> +`PATH`::
> +	When a user runs 'git <command>' that is not part of the core Git programs
> +	(installed in GIT_EXEC_PATH), 'git-<command>' that is runnable by the user
> +	in a directory on `$PATH` is invoked. Argument passed after the command

OK.

> +	name are passed as-is to the runnable program. These commands precedes
> +	alias expansion.

We are not going to try running a program that is not runnable
anyway, so "the runnable program" -> "the program", probably?

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?

Speaking of "alias", I have always felt that it was suboptimal to
make users refer to "git help config" to find out about it.  I
wonder if "git help git" should be the first place users would look
for a help about them?

We have "GIT COMMANDS" section in "git help git" that says "We
divide GIt into porcelain and plumbing" and then have two
subsections there that list commands that belong to these two
categories.  Perhaps leaving some breadcrumbs to redirect them would
be a good start, something like this?

 Documentation/git.adoc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git c/Documentation/git.adoc w/Documentation/git.adoc
index ce099e78b8..fb5b477eda 100644
--- c/Documentation/git.adoc
+++ w/Documentation/git.adoc
@@ -235,7 +235,10 @@ GIT COMMANDS
 ------------
 
 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)
 -------------------------------

  reply	other threads:[~2026-03-03 18:40 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 [this message]
2026-03-03 18:48       ` D. Ben Knoble
2026-03-03 20:11       ` Omri Sarig
2026-03-03 20:36         ` Junio C Hamano
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=xmqqh5qwdaeh.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