diff options
author | Philippe Blain <levraiphilippeblain@gmail.com> | 2024-03-16 22:16:29 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-03-18 17:28:40 +0100 |
commit | ec0300914b42277077f51a8c7e3438d7565eb261 (patch) | |
tree | 098c6439f74730b97cb6cd2e784ab753146a0821 /advice.h | |
parent | The eighth batch (diff) | |
download | git-ec0300914b42277077f51a8c7e3438d7565eb261.tar.xz git-ec0300914b42277077f51a8c7e3438d7565eb261.zip |
sequencer: allow disabling conflict advice
Allow disabling the advice shown when a squencer operation results in a
merge conflict through a new config 'advice.mergeConflict', which is
named generically such that it can be used by other commands eventually.
Remove that final '\n' in the first hunk in sequencer.c to avoid an
otherwise empty 'hint: ' line before the line 'hint: Disable this
message with "git config advice.mergeConflict false"' which is
automatically added by 'advise_if_enabled'.
Note that we use 'advise_if_enabled' for each message in the second hunk
in sequencer.c, instead of using 'if (show_hints &&
advice_enabled(...)', because the former instructs the user how to
disable the advice, which is more user-friendly.
Update the tests accordingly. Note that the body of the second test in
t3507-cherry-pick-conflict.sh is enclosed in double quotes, so we must
escape them in the added line. Note that t5520-pull.sh, which checks
that we display the advice for 'git rebase' (via 'git pull --rebase')
does not have to be updated because it only greps for a specific line in
the advice message.
Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'advice.h')
-rw-r--r-- | advice.h | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -25,6 +25,7 @@ enum advice_type { ADVICE_GRAFT_FILE_DEPRECATED, ADVICE_IGNORED_HOOK, ADVICE_IMPLICIT_IDENTITY, + ADVICE_MERGE_CONFLICT, ADVICE_NESTED_TAG, ADVICE_OBJECT_NAME_WARNING, ADVICE_PUSH_ALREADY_EXISTS, |