git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/1] New remote groups subcommand
@ 2025-05-03 16:09 Lazar Sumar
  2025-05-03 16:09 ` [PATCH 1/1] Add git remote group sub-command Lazar Sumar
  2025-05-05 16:32 ` [PATCH 0/1] New remote groups subcommand Junio C Hamano
  0 siblings, 2 replies; 4+ messages in thread
From: Lazar Sumar @ 2025-05-03 16:09 UTC (permalink / raw)
  To: git; +Cc: Lazar Sumar

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-05-05 16:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-03 16:09 [PATCH 0/1] New remote groups subcommand Lazar Sumar
2025-05-03 16:09 ` [PATCH 1/1] Add git remote group sub-command Lazar Sumar
2025-05-03 17:19   ` rsbecker
2025-05-05 16:32 ` [PATCH 0/1] New remote groups subcommand Junio C Hamano

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).