From: Nguyễn Thái Ngọc Duy Date: Thu, 25 Jan 2018 09:40:31 GMT Subject: [PATCH] merge: support --strategy '?' for git-completion.bash Message-ID: <20180125094031.6584-1-pclouds@gmail.com> Bash completion support gets the list of available strategies with a grep and sed trick which does not work on non-C locale since the anchor string is translated and it does not cover custom strategies either. Let's do it a better way and make git-merge provide all available strategies in machine-readable form. Signed-off-by: Nguyễn Thái Ngọc Duy --- Another, perhaps better, option is add "git merge --list-strategies". It requires some code movement, so I'll try with a simpler approach first. Documentation/merge-options.txt | 3 +++ builtin/merge.c | 7 +++++++ contrib/completion/git-completion.bash | 9 +-------- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Documentation/merge-options.txt b/Documentation/merge-options.txt index 3888c3ff85..cd4342844f 100644 --- a/Documentation/merge-options.txt +++ b/Documentation/merge-options.txt @@ -97,6 +97,9 @@ option can be used to override --squash. If there is no `-s` option, a built-in list of strategies is used instead ('git merge-recursive' when merging a single head, 'git merge-octopus' otherwise). ++ +The special strategy '?' lists all available strategies and exits +immediately. No merge operation is done. -X