{"thread":{"id":"66314","subject":"[PATCH] completion: complete 'git worktree repair'","startedAt":"2026-09-12T00:12:37Z","lastAt":"2026-09-23T13:06:55Z","messageCount":6,"participants":["Yoichi NAKAYAMA via GitGitGadget","Patrick Steinhardt","Yoichi Nakayama"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"552616","messageId":"pull.2218.git.1789171955370.gitgitgadget@gmail.com","threadId":"66314","inReplyTo":null,"subject":"[PATCH] completion: complete 'git worktree repair'","fromName":"Yoichi NAKAYAMA via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2026-09-12T00:12:35Z","receivedAt":"2026-09-12T00:12:37Z","isPatch":true,"body":"From: Yoichi NAKAYAMA <yoichi.nakayama@gmail.com>\n\nAdded completion support for the 'repair' subcommand of worktree. It\noptionally receives a list of paths to linked worktrees or paths to\nworktrees with broken links.\n\nSigned-off-by: Yoichi NAKAYAMA <yoichi.nakayama@gmail.com>\n---\n    completion: complete 'git worktree repair'\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-2218%2Fyoichi%2Fcomplete-worktree-repair-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2218/yoichi/complete-worktree-repair-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/2218\n\n contrib/completion/git-completion.bash | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 9f8b9b50ff..c3a49e2e22 100644\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -3816,7 +3816,7 @@ __git_complete_worktree_paths ()\n \n _git_worktree ()\n {\n-\tlocal subcommands=\"add list lock move prune remove unlock\"\n+\tlocal subcommands=\"add list lock move prune remove repair unlock\"\n \tlocal subcommand subcommand_idx\n \n \tsubcommand=\"$(__git_find_on_cmdline --show-idx \"$subcommands\")\"\n@@ -3866,7 +3866,7 @@ _git_worktree ()\n \t\t\t;;\n \t\tesac\n \t\t;;\n-\tlock,*|remove,*|unlock,*)\n+\tlock,*|remove,*|repair,*|unlock,*)\n \t\t__git_complete_worktree_paths\n \t\t;;\n \tmove,*)\n\nbase-commit: 47ce80527c56f462cb97db4ca8125342204d3783\n-- \ngitgitgadget\n"},{"id":"552667","messageId":"aqeUWrx7pbzDVbVt@pks.im","threadId":"66314","inReplyTo":"pull.2218.git.1789171955370.gitgitgadget@gmail.com","subject":"Re: [PATCH] completion: complete 'git worktree repair'","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-09-14T06:29:46Z","receivedAt":"2026-09-14T06:29:52Z","isPatch":true,"body":"On Sat, Sep 12, 2026 at 12:12:35AM +0000, Yoichi NAKAYAMA via GitGitGadget wrote:\n> From: Yoichi NAKAYAMA <yoichi.nakayama@gmail.com>\n> \n> Added completion support for the 'repair' subcommand of worktree. It\n> optionally receives a list of paths to linked worktrees or paths to\n> worktrees with broken links.\n\nWe typically write commit messages in imperative mood, as if instructing\nthe code to change. We also briefly describe the status quo, even though\nit's not as important in this particular case. An example could be:\n\n  Our Bash completion does not know to complete the \"repair\" subcommand\n  for git-worktree(1). Add support for it.\n\nOne could also try to add in your bit about worktree paths, but that's\nsomething that's quite obviously visible from the diff anyway. So this\nmay or may not be valuable.\n\nOther than that the patch looks good to me.\n\nThanks!\n\nPatrick\n"},{"id":"552700","messageId":"CAF5D8-v2FSJX_dHFmNzaudAtPu76pVX0n5GhMnGjjnT2f3g3Ng@mail.gmail.com","threadId":"66314","inReplyTo":"aqeUWrx7pbzDVbVt@pks.im","subject":"Re: [PATCH] completion: complete 'git worktree repair'","fromName":"Yoichi Nakayama","fromEmail":"yoichi.nakayama@gmail.com","sentAt":"2026-09-14T12:08:15Z","receivedAt":"2026-09-14T12:08:27Z","isPatch":true,"body":"On Mon, Sep 14, 2026 at 3:29 PM Patrick Steinhardt <ps@pks.im> wrote:\n>\n> On Sat, Sep 12, 2026 at 12:12:35AM +0000, Yoichi NAKAYAMA via GitGitGadget wrote:\n> > From: Yoichi NAKAYAMA <yoichi.nakayama@gmail.com>\n> >\n> > Added completion support for the 'repair' subcommand of worktree. It\n> > optionally receives a list of paths to linked worktrees or paths to\n> > worktrees with broken links.\n>\n> We typically write commit messages in imperative mood, as if instructing\n> the code to change. We also briefly describe the status quo, even though\n> it's not as important in this particular case. An example could be:\n>\n>   Our Bash completion does not know to complete the \"repair\" subcommand\n>   for git-worktree(1). Add support for it.\n>\n> One could also try to add in your bit about worktree paths, but that's\n> something that's quite obviously visible from the diff anyway. So this\n> may or may not be valuable.\n\nThank you for your comment.\nSince this is not limited to bash, it also adds completion support\nfor zsh and tcsh via git-completion.{zsh,tcsh}.\nSo I'd like to modify the body of the commit message as follows:\n\n  The completion scripts do not complete the \"repair\" subcommand for\n  git-worktree(1). Add support for it.\n\nThanks\n\n> Other than that the patch looks good to me.\n>\n> Thanks!\n>\n> Patrick\n\n\n\n-- \nYoichi NAKAYAMA\n"},{"id":"552726","messageId":"pull.2218.v2.git.1789414536838.gitgitgadget@gmail.com","threadId":"66314","inReplyTo":"pull.2218.git.1789171955370.gitgitgadget@gmail.com","subject":"[PATCH v2] completion: complete 'git worktree repair'","fromName":"Yoichi NAKAYAMA via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2026-09-14T19:35:36Z","receivedAt":"2026-09-14T19:35:39Z","isPatch":true,"body":"From: Yoichi NAKAYAMA <yoichi.nakayama@gmail.com>\n\nThe completion scripts do not complete the \"repair\" subcommand for\ngit-worktree(1). Add support for it.\n\nSigned-off-by: Yoichi NAKAYAMA <yoichi.nakayama@gmail.com>\n---\n    completion: complete 'git worktree repair'\n\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-2218%2Fyoichi%2Fcomplete-worktree-repair-v2\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2218/yoichi/complete-worktree-repair-v2\nPull-Request: https://github.com/gitgitgadget/git/pull/2218\n\nRange-diff vs v1:\n\n 1:  84cfa0da2d ! 1:  4f3f233065 completion: complete 'git worktree repair'\n     @@ Metadata\n       ## Commit message ##\n          completion: complete 'git worktree repair'\n      \n     -    Added completion support for the 'repair' subcommand of worktree. It\n     -    optionally receives a list of paths to linked worktrees or paths to\n     -    worktrees with broken links.\n     +    The completion scripts do not complete the \"repair\" subcommand for\n     +    git-worktree(1). Add support for it.\n      \n          Signed-off-by: Yoichi NAKAYAMA <yoichi.nakayama@gmail.com>\n      \n\n\n contrib/completion/git-completion.bash | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex 9f8b9b50ff..c3a49e2e22 100644\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -3816,7 +3816,7 @@ __git_complete_worktree_paths ()\n \n _git_worktree ()\n {\n-\tlocal subcommands=\"add list lock move prune remove unlock\"\n+\tlocal subcommands=\"add list lock move prune remove repair unlock\"\n \tlocal subcommand subcommand_idx\n \n \tsubcommand=\"$(__git_find_on_cmdline --show-idx \"$subcommands\")\"\n@@ -3866,7 +3866,7 @@ _git_worktree ()\n \t\t\t;;\n \t\tesac\n \t\t;;\n-\tlock,*|remove,*|unlock,*)\n+\tlock,*|remove,*|repair,*|unlock,*)\n \t\t__git_complete_worktree_paths\n \t\t;;\n \tmove,*)\n\nbase-commit: 47ce80527c56f462cb97db4ca8125342204d3783\n-- \ngitgitgadget\n"},{"id":"553049","messageId":"arPMLIi7FL52CVJk@pks.im","threadId":"66314","inReplyTo":"pull.2218.v2.git.1789414536838.gitgitgadget@gmail.com","subject":"Re: [PATCH v2] completion: complete 'git worktree repair'","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-09-23T12:57:40Z","receivedAt":"2026-09-23T12:57:57Z","isPatch":true,"body":"On Mon, Sep 14, 2026 at 07:35:36PM +0000, Yoichi NAKAYAMA via GitGitGadget wrote:\n> From: Yoichi NAKAYAMA <yoichi.nakayama@gmail.com>\n> \n> The completion scripts do not complete the \"repair\" subcommand for\n> git-worktree(1). Add support for it.\n> \n> Signed-off-by: Yoichi NAKAYAMA <yoichi.nakayama@gmail.com>\n\nThanks, this looks good to me!\n\nPatrick\n"},{"id":"553055","messageId":"arPO6GzJVjjdndTN@pks.im","threadId":"66314","inReplyTo":"CAF5D8-v2FSJX_dHFmNzaudAtPu76pVX0n5GhMnGjjnT2f3g3Ng@mail.gmail.com","subject":"Re: [PATCH] completion: complete 'git worktree repair'","fromName":"Patrick Steinhardt","fromEmail":"ps@pks.im","sentAt":"2026-09-23T13:06:48Z","receivedAt":"2026-09-23T13:06:55Z","isPatch":true,"body":"On Mon, Sep 14, 2026 at 09:08:15PM +0900, Yoichi Nakayama wrote:\n> On Mon, Sep 14, 2026 at 3:29 PM Patrick Steinhardt <ps@pks.im> wrote:\n> >\n> > On Sat, Sep 12, 2026 at 12:12:35AM +0000, Yoichi NAKAYAMA via GitGitGadget wrote:\n> > > From: Yoichi NAKAYAMA <yoichi.nakayama@gmail.com>\n> > >\n> > > Added completion support for the 'repair' subcommand of worktree. It\n> > > optionally receives a list of paths to linked worktrees or paths to\n> > > worktrees with broken links.\n> >\n> > We typically write commit messages in imperative mood, as if instructing\n> > the code to change. We also briefly describe the status quo, even though\n> > it's not as important in this particular case. An example could be:\n> >\n> >   Our Bash completion does not know to complete the \"repair\" subcommand\n> >   for git-worktree(1). Add support for it.\n> >\n> > One could also try to add in your bit about worktree paths, but that's\n> > something that's quite obviously visible from the diff anyway. So this\n> > may or may not be valuable.\n> \n> Thank you for your comment.\n> Since this is not limited to bash, it also adds completion support\n> for zsh and tcsh via git-completion.{zsh,tcsh}.\n> So I'd like to modify the body of the commit message as follows:\n> \n>   The completion scripts do not complete the \"repair\" subcommand for\n>   git-worktree(1). Add support for it.\n\nAh, fair. We know to reuse the Bash completion scripts for both of\nthese.\n\nPatrick\n"}]}