git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: git@vger.kernel.org
Cc: "D. Ben Knoble via GitGitGadget" <gitgitgadget@gmail.com>,
	"D. Ben Knoble" <ben.knoble+github@gmail.com>
Subject: Re: [PATCH] grep: document negated line-number, column long options
Date: Thu, 16 Jan 2025 16:29:47 -0800	[thread overview]
Message-ID: <xmqqfrlinuys.fsf@gitster.g> (raw)
In-Reply-To: <xmqqy0zanzdw.fsf@gitster.g> (Junio C. Hamano's message of "Thu, 16 Jan 2025 14:54:19 -0800")

Junio C Hamano <gitster@pobox.com> writes:

> As nobody complains that "I cannot understand what --no-progress,
> which is described in the above, means", there must be a central
> place where we describe this convention ("git help cli" talks about
> negating options).

I looked for it for a while and noticed that we do not seem to
officially state that command line options trump configuration
variables.  Which is a bit hard to believe for an old timer like me
who taught our developers for 20-years that it is one of the
conventions they must make sure their new commands, options and
configuration variables follow.

In any case, perhaps something along the lines of the following would
help?  This is in the vicinity of where we describe that `--no-track`
is a way to override `--track`.

It is entirely possible that this patch is not needed and I didn't
look hard enough to find an existing documentation that says it
already, though.

---- >8 ----
Subject: [PATCH] gitcli: document that command line trumps configuration

We centrally explain that "--no-whatever" is the way to countermand
the "--whatever" option.  Explain that a configured default can be
overridden by the corresponding command line option, too.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 Documentation/gitcli.txt | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git c/Documentation/gitcli.txt w/Documentation/gitcli.txt
index fcd86d2eee..5b6f0e4a4b 100644
--- c/Documentation/gitcli.txt
+++ w/Documentation/gitcli.txt
@@ -161,6 +161,20 @@ can use `--no-track` to override that behaviour. The same goes for `--color`
 and `--no-color`.
 
 
+Options trump configuration
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+When there is a configuration variable and a command line option
+that tweaks the behaviour of the same aspect of a Git command,
+the command line option overrides the configuration variable.
+
+For example, the `user.signingKey` configuration variable is used to
+specify the default key used by the `git tag -s` command to create a
+signed tag.  By giving the `-u <key-id>` option to `git tag`, which
+specif es the key used to sign a tag, the key specified by the `-u`
+option on the command line is used, instead of the configured
+`user.signingKey`.
+
+
 Aggregating short options
 ~~~~~~~~~~~~~~~~~~~~~~~~~
 Commands that support the enhanced option parser allow you to aggregate short

  reply	other threads:[~2025-01-17  0:29 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 [this message]
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
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=xmqqfrlinuys.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=ben.knoble+github@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@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;
as well as URLs for NNTP newsgroup(s).