Skip to content

Allow custom merge strategies

Miklos Vajna git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest7 patches 11 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7Make is_git_command() usable outside builtin-helpMakefile help.c help.h+21 -114 replies
2/7builtin-help: change the current directory back in list_commands_in_dir()help.c+3 -04 replies
3/7builtin-help: make list_commands() a bit more generichelp.c help.h+11 -80 replies
3/7builtin-help: make list_commands() a bit more generichelp.c help.h+6 -51 reply
4/7builtin-merge: allow using a custom strategybuiltin-merge.c+12 -70 replies
5/7Add a new test for using a custom merge strategyt/t7606-merge-custom.sh+45 -00 replies
6/7builtin-help: make it possible to exclude some commands in list_commands()help.c help.h+23 -150 replies
7/7builtin-merge: avoid non-strategy git-merge commands in error messagebuiltin-merge.c+13 -10 replies
7/7builtin-merge: avoid non-strategy git-merge commands in error messagebuiltin-merge.c+12 -16 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/7] Allow custom merge strategies

Hi,

This series adds support for custom merge strategies.

The first 3 patches modify builtin-help to allow using it from other builtins. This is necessary because in the error message of 'git merge -s foobar' we show something like 'git help -a', but we list only merge strategies. A command is considered a merge strategy if it has a git-merge- prefix and is listed in the all_strategy array or it is somewhere in PATH, but outside git --exec-path, so that git-merge-ours and other strategies are shown, git-merge-index and other git-merge-named (but not strategy) commands are hidden.

The last two is about removing those problematic 'git-merge-index', 'git-merge-tree' and other bogus commands from the output of 'git merge -s foobar'. I think the benefit of doing it that way is that we don't have to maintain a list of commands which are named git-merge-foo but not strategies _and_ the custom strategies can have a form of git-merge-foo, without adding extra complexity (like forcing users to name them git-merge-custom-foo).

NOTE: At the moment the custom strategies are named as git-merge-foo as well, mainly because I think it's not that problematic to exclude the already existing git-merge-fo non-strategy commands, but this can be changed to git-merge-strategy-foo if we really want so.

Also, I'm aware that this is a feature and we are in rc freeze, I just did not want to keep back this series till 1.6.0 is out.

Miklos Vajna (7):
Make is_git_command() usable outside builtin-help
builtin-help: change the current directory back in
list_commands_in_dir()
builtin-help: make list_commands() a bit more generic
builtin-merge: allow using a custom strategy
Add a new test for using a custom merge strategy
builtin-help: make it possible to exclude some commands in
list_commands()
builtin-merge: avoid non-strategy git-merge commands in error message

 Makefile                |    1 +
 builtin-merge.c         |   30 +++++++++++++++++++++------
 help.c                  |   50 ++++++++++++++++++++++++----------------------
 help.h                  |   19 +++++++++++++++++
 t/t7606-merge-custom.sh |   45 ++++++++++++++++++++++++++++++++++++++++++
 5 files changed, 114 insertions(+), 31 deletions(-)
 create mode 100644 help.h
 create mode 100755 t/t7606-merge-custom.sh