Volume XXII, number 279Tuesday, October 6, 2026Latest message 1 hour ago

The Git List

News and archive of git@vger.kernel.org, since April 2005

patchcompletion: complete 'git worktree repair'

6 messages between Sep 12, 2026 and Sep 23, 2026, from Yoichi NAKAYAMA via GitGitGadget, Patrick Steinhardt, Yoichi Nakayama.

Plain Markdown or JSON for tools and agents. Diffs are folded; open one to read it.

Yoichi NAKAYAMA via GitGitGadgetSep 12, 2026, 00:12 UTC on lore
From: Yoichi NAKAYAMA <yoichi.nakayama@gmail.com>

Added completion support for the 'repair' subcommand of worktree. It optionally receives a list of paths to linked worktrees or paths to worktrees with broken links.

Signed-off-by: Yoichi NAKAYAMA <yoichi.nakayama@gmail.com>
---
    completion: complete 'git worktree repair'
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-2218%2Fyoichi%2Fcomplete-worktree-repair-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2218/yoichi/complete-worktree-repair-v1
Pull-Request: https://github.com/gitgitgadget/git/pull/2218
 contrib/completion/git-completion.bash | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Show changes to contrib/completion/git-completion.bash +2 −2
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 9f8b9b50ff..c3a49e2e22 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -3816,7 +3816,7 @@ __git_complete_worktree_paths ()
 
 _git_worktree ()
 {
-	local subcommands="add list lock move prune remove unlock"
+	local subcommands="add list lock move prune remove repair unlock"
 	local subcommand subcommand_idx
 
 	subcommand="$(__git_find_on_cmdline --show-idx "$subcommands")"
@@ -3866,7 +3866,7 @@ _git_worktree ()
 			;;
 		esac
 		;;
-	lock,*|remove,*|unlock,*)
+	lock,*|remove,*|repair,*|unlock,*)
 		__git_complete_worktree_paths
 		;;
 	move,*)

base-commit: 47ce80527c56f462cb97db4ca8125342204d3783
-- 
gitgitgadget
Patrick SteinhardtSep 14, 2026, 06:29 UTC in reply to Yoichi NAKAYAMA via GitGitGadget on lore

Re: [PATCH] completion: complete 'git worktree repair'

On Sat, Sep 12, 2026 at 12:12:35AM +0000, Yoichi NAKAYAMA via GitGitGadget wrote:
Show 5 quoted lines
> From: Yoichi NAKAYAMA <yoichi.nakayama@gmail.com>
> 
> Added completion support for the 'repair' subcommand of worktree. It
> optionally receives a list of paths to linked worktrees or paths to
> worktrees with broken links.

We typically write commit messages in imperative mood, as if instructing the code to change. We also briefly describe the status quo, even though it's not as important in this particular case. An example could be:

  Our Bash completion does not know to complete the "repair" subcommand
  for git-worktree(1). Add support for it.

One could also try to add in your bit about worktree paths, but that's something that's quite obviously visible from the diff anyway. So this may or may not be valuable.

Other than that the patch looks good to me.
Thanks!
Patrick
Yoichi NakayamaSep 14, 2026, 12:08 UTC in reply to Patrick Steinhardt on lore

Re: [PATCH] completion: complete 'git worktree repair'

On Mon, Sep 14, 2026 at 3:29 PM Patrick Steinhardt <ps@pks.im> wrote:
Show 18 quoted lines
>
> On Sat, Sep 12, 2026 at 12:12:35AM +0000, Yoichi NAKAYAMA via GitGitGadget wrote:
> > From: Yoichi NAKAYAMA <yoichi.nakayama@gmail.com>
> >
> > Added completion support for the 'repair' subcommand of worktree. It
> > optionally receives a list of paths to linked worktrees or paths to
> > worktrees with broken links.
>
> We typically write commit messages in imperative mood, as if instructing
> the code to change. We also briefly describe the status quo, even though
> it's not as important in this particular case. An example could be:
>
>   Our Bash completion does not know to complete the "repair" subcommand
>   for git-worktree(1). Add support for it.
>
> One could also try to add in your bit about worktree paths, but that's
> something that's quite obviously visible from the diff anyway. So this
> may or may not be valuable.

Thank you for your comment. Since this is not limited to bash, it also adds completion support for zsh and tcsh via git-completion.{zsh,tcsh}. So I'd like to modify the body of the commit message as follows:

  The completion scripts do not complete the "repair" subcommand for
  git-worktree(1). Add support for it.
Thanks
Show 5 quoted lines
> Other than that the patch looks good to me.
>
> Thanks!
>
> Patrick
-- 
Yoichi NAKAYAMA
Yoichi NAKAYAMA via GitGitGadgetSep 14, 2026, 19:35 UTC in reply to Yoichi NAKAYAMA via GitGitGadget on lore

[PATCH v2] completion: complete 'git worktree repair'

From: Yoichi NAKAYAMA <yoichi.nakayama@gmail.com>

The completion scripts do not complete the "repair" subcommand for git-worktree(1). Add support for it.

Signed-off-by: Yoichi NAKAYAMA <yoichi.nakayama@gmail.com>
---
    completion: complete 'git worktree repair'
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-2218%2Fyoichi%2Fcomplete-worktree-repair-v2
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2218/yoichi/complete-worktree-repair-v2
Pull-Request: https://github.com/gitgitgadget/git/pull/2218
Range-diff vs v1:
 1:  84cfa0da2d ! 1:  4f3f233065 completion: complete 'git worktree repair'
     @@ Metadata
       ## Commit message ##
          completion: complete 'git worktree repair'
      
     -    Added completion support for the 'repair' subcommand of worktree. It
     -    optionally receives a list of paths to linked worktrees or paths to
     -    worktrees with broken links.
     +    The completion scripts do not complete the "repair" subcommand for
     +    git-worktree(1). Add support for it.
      
          Signed-off-by: Yoichi NAKAYAMA <yoichi.nakayama@gmail.com>
      
 contrib/completion/git-completion.bash | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Show changes to contrib/completion/git-completion.bash +2 −2
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 9f8b9b50ff..c3a49e2e22 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -3816,7 +3816,7 @@ __git_complete_worktree_paths ()
 
 _git_worktree ()
 {
-	local subcommands="add list lock move prune remove unlock"
+	local subcommands="add list lock move prune remove repair unlock"
 	local subcommand subcommand_idx
 
 	subcommand="$(__git_find_on_cmdline --show-idx "$subcommands")"
@@ -3866,7 +3866,7 @@ _git_worktree ()
 			;;
 		esac
 		;;
-	lock,*|remove,*|unlock,*)
+	lock,*|remove,*|repair,*|unlock,*)
 		__git_complete_worktree_paths
 		;;
 	move,*)

base-commit: 47ce80527c56f462cb97db4ca8125342204d3783
-- 
gitgitgadget
Patrick SteinhardtSep 23, 2026, 12:57 UTC in reply to Yoichi NAKAYAMA via GitGitGadget on lore

Re: [PATCH v2] completion: complete 'git worktree repair'

On Mon, Sep 14, 2026 at 07:35:36PM +0000, Yoichi NAKAYAMA via GitGitGadget wrote:
Show 6 quoted lines
> From: Yoichi NAKAYAMA <yoichi.nakayama@gmail.com>
> 
> The completion scripts do not complete the "repair" subcommand for
> git-worktree(1). Add support for it.
> 
> Signed-off-by: Yoichi NAKAYAMA <yoichi.nakayama@gmail.com>
Thanks, this looks good to me!
Patrick
Patrick SteinhardtSep 23, 2026, 13:06 UTC in reply to Yoichi Nakayama on lore

Re: [PATCH] completion: complete 'git worktree repair'

On Mon, Sep 14, 2026 at 09:08:15PM +0900, Yoichi Nakayama wrote:
Show 27 quoted lines
> On Mon, Sep 14, 2026 at 3:29 PM Patrick Steinhardt <ps@pks.im> wrote:
> >
> > On Sat, Sep 12, 2026 at 12:12:35AM +0000, Yoichi NAKAYAMA via GitGitGadget wrote:
> > > From: Yoichi NAKAYAMA <yoichi.nakayama@gmail.com>
> > >
> > > Added completion support for the 'repair' subcommand of worktree. It
> > > optionally receives a list of paths to linked worktrees or paths to
> > > worktrees with broken links.
> >
> > We typically write commit messages in imperative mood, as if instructing
> > the code to change. We also briefly describe the status quo, even though
> > it's not as important in this particular case. An example could be:
> >
> >   Our Bash completion does not know to complete the "repair" subcommand
> >   for git-worktree(1). Add support for it.
> >
> > One could also try to add in your bit about worktree paths, but that's
> > something that's quite obviously visible from the diff anyway. So this
> > may or may not be valuable.
> 
> Thank you for your comment.
> Since this is not limited to bash, it also adds completion support
> for zsh and tcsh via git-completion.{zsh,tcsh}.
> So I'd like to modify the body of the commit message as follows:
> 
>   The completion scripts do not complete the "repair" subcommand for
>   git-worktree(1). Add support for it.

Ah, fair. We know to reuse the Bash completion scripts for both of these.

Patrick

Back to recent threads