git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] completion: new config var to use --sort in for-each-ref

From
D. Ben Knoble <ben.knoble@gmail.com>
Date
Jun 27, 2025, 19:15 UTC
Message-ID
<CALnO6CB4voTTQZrg5OjgHOhuVP4_B71f7LuNFeHNYby4kXOu4A@mail.gmail.com>
In-Reply-To
<CAAUd64333fEMHAaNW=-CkfUMN4HDFF2v==HdO0OFnOgm+W+Jog@mail.gmail.com>
On Sun, Jun 8, 2025 at 12:22 PM Nelson Benítez León <nbenitezl@gmail.com> wrote:
>
> Hi, I'm attaching a patch for the Bash completion script, to be able
> to change the default implicit alphabetical ordering used when
> returning refs e.g. when doing "git checkout <TAB>"

I keep meaning to come back and review this, and then I see that the patch is an attached file and not sent over plaintext (which was necessary because the GMail web client breaks patches). Perhaps you could submit your patch via GitGitGadget (https://gitgitgadget.github.io/) so that submission is in the expected shape for this project?

Show 15 quoted lines
>
> I wanted the completed refs to be ordered descending by committer date
> i.e. --sort="-committerdate" because that shows on top the branches
> I've been recently working on. The completion script didn't allow to
> set a custom ordering from the default alphabetical one, so I'm
> sending a patch which adds a new config var where the user can set
> their desired custom ordering.
>
> I've not added tests because I'm not familiar with the test machinery,
> hopefully this is still useful.
>
> Regards,
>
> PD. I send from Gmail web interface because git send-email for Gmail
> requires 2-factor authentication and I chose not to enable it.
-- 
D. Ben Knoble
Previous: Nelson Benítez LeónNext: Kristoffer Haugsbakk
Message 2 of 4 in “completion: new config var to use --sort in for-each-ref”
  1. completion: new config var to use --sort in for-each-refNelson Benítez León, Jun 8, 2025
  2. D. Ben KnobleJun 27, 2025
  3. Kristoffer HaugsbakkJun 27, 2025
  4. D. Ben KnobleJun 27, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.