summaryrefslogtreecommitdiff
path: root/builtin/notes.c
diff options
context:
space:
mode:
authorJohan Herland <johan@herland.net>2010-11-09 22:49:51 +0100
committerJunio C Hamano <gitster@pobox.com>2010-11-17 13:22:49 -0800
commit809f38c8abacdbeb7015fdeef03931568c7fddda (patch)
tree22123012e953120aa713d1839c175e6f512b61da /builtin/notes.c
parent00f03061e27cad5497abcca2b70fa9fa04818275 (diff)
downloadgit-809f38c8abacdbeb7015fdeef03931568c7fddda.tar.gz
git notes merge: Manual conflict resolution, part 1/2
Conflicts (that are to be resolved manually) are written into a special- purpose working tree, located at .git/NOTES_MERGE_WORKTREE. Within this directory, conflicting notes entries are stored (with conflict markers produced by ll_merge()) using the SHA1 of the annotated object. The .git/NOTES_MERGE_WORKTREE directory will only contain the _conflicting_ note entries. The non-conflicting note entries (aka. the partial merge result) are stored in 'local_tree', and the SHA1 of the resulting commit is written to 'result_sha1'. The return value from notes_merge() is -1. The user is told to edit the files within the .git/NOTES_MERGE_WORKTREE directory in order to resolve the conflicts. The patch also contains documentation and testcases for the correct setup of .git/NOTES_MERGE_WORKTREE. The next part will recombine the partial notes merge result with the resolved conflicts in .git/NOTES_MERGE_WORKTREE to produce the complete merge result. This patch has been improved by the following contributions: - Jonathan Nieder: Use trace_printf(...) instead of OUTPUT(o, 5, ...) Thanks-to: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/notes.c')
-rw-r--r--builtin/notes.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/builtin/notes.c b/builtin/notes.c
index 64b2be97ef..309edc741e 100644
--- a/builtin/notes.c
+++ b/builtin/notes.c
@@ -820,14 +820,14 @@ static int merge(int argc, const char **argv, const char *prefix)
/* Update default notes ref with new commit */
update_ref(msg.buf, default_notes_ref(), result_sha1, NULL,
0, DIE_ON_ERR);
- else
- /* TODO: */
- die("'git notes merge' cannot yet handle conflicts!");
+ else /* Merge has unresolved conflicts */
+ printf("Automatic notes merge failed. Fix conflicts in %s.\n",
+ git_path(NOTES_MERGE_WORKTREE));
free_notes(t);
strbuf_release(&remote_ref);
strbuf_release(&msg);
- return 0;
+ return result < 0; /* return non-zero on conflicts */
}
static int remove_cmd(int argc, const char **argv, const char *prefix)