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

[PATCH 0/1] New remote groups subcommand

From
LSLazar Sumar <sumar@lazar.co.nz>
Date
May 3, 2025, 16:09 UTC
Message-ID
<20250503160953.196329-1-bugzilla@lazar.co.nz>
First submission, any guidance is appreciated.

Having recently started using remote groups I have found the feature to be missing:

  * bash completion
  * easy listing functionality
  * remote renames don't update group members with the rename (tricky)

This patch aims to fix the bash completion and simplify listing remote groups by adding a `git remote group` subcommand.

Note: the bash completion can be solved without the subcommand, using
something like:
    `git config --get-regexp 'remotes\.' | awk ...

but if this feature is intended to be supported then giving it a subcommand felt like the better approach.

Lastly, I wanted to at least add a test for the expected behavior of remote grups when a remote is renamed but found the current behavior surprising, i.e.

    $ git config --get-regexp 'remotes\.'
    file:.git/config        remotes.group1 upstream origin
    $ git remote rename origin fork
    Renaming remote references: 100% (8/8), done.
    $ git config --get-regexp 'remotes\.'
    file:.git/config        remotes.group1 upstream origin

The remote group is defined in the local config file and I would expect the rename to rename the group member here. However, should the group have been defined in the global `~/.gitconfig` the current behavior makes perfect sense.

As this was unclear, I decided not to include it in this patch series but considering that the area I am touching is the same, any comments would be appreciated. If we reach a conclusion I'm happy to create a new patch series to follow up on this.

Lazar Sumar (1):
  Add git remote group sub-command
 Documentation/git-remote.adoc          |  6 ++++
 builtin/remote.c                       | 47 ++++++++++++++++++++++++++
 contrib/completion/git-completion.bash | 21 ++++++++++--
 t/t5506-remote-groups.sh               | 31 +++++++++++++++++
 4 files changed, 103 insertions(+), 2 deletions(-)
base-commit: f65182a99e545d2f2bc22e6c1c2da192133b16a3
-- 
2.49.0.460.g0390bdefd0.dirty
Next: Lazar Sumar
Message 1 of 4 in “New remote groups subcommand”
  1. 0/1 New remote groups subcommandLazar Sumar, May 3, 2025
  2. 1/1 Add git remote group sub-commandLazar Sumar, May 3, 2025
  3. rsbecker@nexbridge.comMay 3, 2025
  4. Junio C HamanoMay 5, 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.