From: "Kristoffer Haugsbakk" <kristofferhaugsbakk@fastmail.com>
To: "Nelson Benítez León" <nbenitezl@gmail.com>, git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>
Subject: Re: [PATCH] completion: new config var to use --sort in for-each-ref
Date: Fri, 27 Jun 2025 21:47:40 +0200 [thread overview]
Message-ID: <a3cd775d-99fa-49de-881b-1e8f178f9102@app.fastmail.com> (raw)
In-Reply-To: <CAAUd64333fEMHAaNW=-CkfUMN4HDFF2v==HdO0OFnOgm+W+Jog@mail.gmail.com>
> Previously when completing refs eg. "git checkout <TAB>"
> all refs were alphabetically ordered, this was an
> implicit ordering and could not be changed.
Style-wise, the commit message is supposed to discuss the current
behavior (without the patch) in the present tense and what this patch
does in the imperative mood. Like you are commanding the code to
change.[1] Something like:
When completing refs, e.g. "git checkout <TAB>", all refs are
alphabetically ordered; this is an implicit ordering and cannot be
changed.
This also gels with the general pattern of:
1. Introduce the current behavior
2. The problem it causes (maybe merged with (1))
3. What to do to fix it
> Previously when completing refs eg. "git checkout <TAB>"
s/eg./e.g./
Maybe also some commas like
..., e.g. "git checkout <TAB>", ...
Or maybe it should be “i.e.”?
> This commit adds a new config var to allow setting
> a custom ordering, the conf value will be used
> for the --sort=<val> of for-each-ref.
>
> When a custom ordering is not set then alphabetical
> default is kept, but this time is explicit as we
> pass --sort='refname'
>
> This commit also adds '-o nosort' to 'complete'
> to disable its default alphabetical ordering so
> our custom ordering prevails.
Super nitpick: the paragraphs could be wrapped closer to 72 characters/
columns.[2][3] This alternative (slightly modified) is closer
to that yet not very uneven, still.
Previously when completing refs eg. "git checkout <TAB>" all refs
were alphabetically ordered, this was an implicit ordering and could
not be changed.
This commit adds a new config var to allow setting a custom ordering,
the conf value will be used for the --sort=<val> of for-each-ref.
When a custom ordering is not set then alphabetical default is kept,
but this time is explicit as we pass --sort='refname'
This commit also adds '-o nosort' to 'complete' to disable its default
alphabetical ordering so our custom ordering prevails.
> This commit also adds '-o nosort' to 'complete'
“This commit” should be replaced with just the imperative style
“Also add”.[1]
† 1: See Documentation/SubmittingPatches, “imperative-mood”
🔗 2: https://lore.kernel.org/git/CAPig+cT1VfY8QiUvrrV3-obTBP1439b6iwaebJtGwML5MScnQA@mail.gmail.com/
--
cheers
Kristoffer Haugsbakk
next prev parent reply other threads:[~2025-06-27 19:48 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-08 16:21 [PATCH] completion: new config var to use --sort in for-each-ref Nelson Benítez León
2025-06-27 19:15 ` D. Ben Knoble
2025-06-27 19:47 ` Kristoffer Haugsbakk [this message]
2025-06-27 19:53 ` D. Ben Knoble
-- strict thread matches above, loose matches on Subject: below --
2025-07-27 14:49 Nelson Benitez Leon via GitGitGadget
2025-07-27 15:06 ` Nelson Benítez León
2025-07-27 22:21 ` Junio C Hamano
2025-07-28 17:13 ` SZEDER Gábor
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=a3cd775d-99fa-49de-881b-1e8f178f9102@app.fastmail.com \
--to=kristofferhaugsbakk@fastmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=nbenitezl@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).