From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH v2] gitcli: document that command line trumps config and env
Date: Fri, 17 Jan 2025 02:41:31 +0000 [thread overview]
Message-ID: <Z4nDW2FQ-MdWbW5P@tapette.crustytoothpaste.net> (raw)
In-Reply-To: <xmqqzfjqmbza.fsf@gitster.g>
[-- Attachment #1: Type: text/plain, Size: 1705 bytes --]
On 2025-01-17 at 02:05:13, Junio C Hamano wrote:
> diff --git a/Documentation/gitcli.txt b/Documentation/gitcli.txt
> index 7c709324ba..00b71bc462 100644
> --- a/Documentation/gitcli.txt
> +++ b/Documentation/gitcli.txt
> @@ -152,6 +152,23 @@ can use `--no-track` to override that behaviour. The same goes for `--color`
> and `--no-color`.
>
>
> +Options trump configuration and environment
> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> +
> +When there is a configuration variable or an environment variable
> +that tweak the behaviour of an aspect of a Git command, and also a
> +command line option that tweaks the same, the command line option
> +overrides what the configuration and/or environment variable say.
> +
> +For example, the `user.name` configuration variable is used to
> +specify the human-readable name used by the `git commit` command to
> +record the author and the committer name in a newly created commit.
> +The `GIT_AUTHOR_NAME` environment variable, if set, takes precedence
> +when deciding what author name to record. The `--author=<author>`
> +command line option of the `git commit` command, when given, takes
> +precedence over these two sources of information.
I appreciate you taking the time to document this. I remember it coming
up recently on the list and it's good that we're writing this down and
documenting it.
This is useful not only for end users, but also new contributors who
might want to implement a feature or authors of other tools which
interact with Git, who will be able to write tooling that behaves in a
similar way on the first go-around.
--
brian m. carlson (they/them or he/him)
Toronto, Ontario, CA
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 263 bytes --]
next prev parent reply other threads:[~2025-01-17 2:41 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-16 22:20 [PATCH] grep: document negated line-number, column long options D. Ben Knoble via GitGitGadget
2025-01-16 22:54 ` Junio C Hamano
2025-01-17 0:29 ` Junio C Hamano
2025-01-17 2:05 ` [PATCH v2] gitcli: document that command line trumps config and env Junio C Hamano
2025-01-17 2:41 ` brian m. carlson [this message]
2025-01-17 18:09 ` Junio C Hamano
2025-01-17 3:14 ` [PATCH] grep: document negated line-number, column long options Eric Sunshine
2025-01-19 23:17 ` D. Ben Knoble
2025-01-21 20:51 ` 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z4nDW2FQ-MdWbW5P@tapette.crustytoothpaste.net \
--to=sandals@crustytoothpaste.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.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;
as well as URLs for NNTP newsgroup(s).