path: root/notes-merge.h
diff options
authorJohan Herland <>2010-11-14 23:55:12 (GMT)
committerJunio C Hamano <>2010-11-17 21:21:58 (GMT)
commit3228e67120a8c71bf7804a5c52448a841d6f3b58 (patch)
tree7cd1562259a3942cc2811c2a4f557d077649698a /notes-merge.h
parent2085b16aefdbb1dc081aa40c62eb8110a222731d (diff)
git notes merge: Add automatic conflict resolvers (ours, theirs, union)
The new -s/--strategy command-line option to 'git notes merge' allow the user to choose how notes merge conflicts should be resolved. There are four valid strategies to choose from: 1. "manual" (the default): This will let the user manually resolve conflicts. This option currently fails with an error message. It will be implemented properly in future patches. 2. "ours": This automatically chooses the local version of a conflict, and discards the remote version. 3. "theirs": This automatically chooses the remote version of a conflict, and discards the local version. 4. "union": This automatically resolves the conflict by appending the remote version to the local version. The strategies are implemented using the combine_notes_* functions from the notes.h API. The patch also includes testcases verifying the correct implementation of these strategies. This patch has been improved by the following contributions: - Jonathan Nieder: Future-proof by always checking add_note() return value - Stephen Boyd: Use test_commit - Stephen Boyd: Use correct option name Thanks-to: Jonathan Nieder <> Thanks-to: Stephen Boyd <> Signed-off-by: Johan Herland <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'notes-merge.h')
1 files changed, 6 insertions, 0 deletions
diff --git a/notes-merge.h b/notes-merge.h
index 577cfb3..ed356ae 100644
--- a/notes-merge.h
+++ b/notes-merge.h
@@ -11,6 +11,12 @@ struct notes_merge_options {
const char *remote_ref;
const char *commit_msg;
int verbosity;
+ enum {
+ } strategy;
void init_notes_merge_options(struct notes_merge_options *o);