[PATCH 0/1] New remote groups subcommand
- From
- Lazar 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 originThe 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