git-commit-vandalism/builtin
Johan Herland 6cfd6a9dea git notes merge: --commit should fail if underlying notes ref has moved
When manually resolving a notes merge, if the merging ref has moved since
the merge started, we should fail to complete the merge, and alert the user
to what's going on.

This situation may arise if you start a 'git notes merge' which results in
conflicts, and you then update the current notes ref (using for example
'git notes add/copy/amend/edit/remove/prune', 'git update-ref', etc.),
before you get around to resolving the notes conflicts and calling
'git notes merge --commit'.

We detect this situation by comparing the first parent of the partial merge
commit (which was created when the merge started) to the current value of the
merging notes ref (pointed to by the .git/NOTES_MERGE_REF symref).

If we don't fail in this situation, the notes merge commit would overwrite
the updated notes ref, thus losing the changes that happened in the meantime.

The patch includes a testcase verifying that we fail correctly in this
situation.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-11-17 13:22:49 -08:00
..
add.c git add: Add the "--ignore-missing" option for the dry run 2010-07-12 15:13:54 -07:00
annotate.c
apply.c Merge branch 'jp/string-list-api-cleanup' 2010-06-30 11:55:38 -07:00
archive.c
bisect--helper.c
blame.c Merge branch 'cp/textconv-cat-file' 2010-06-27 12:07:55 -07:00
branch.c Merge branch 'sm/branch-broken-ref' 2010-06-21 06:02:47 -07:00
bundle.c
cat-file.c Merge branch 'cp/textconv-cat-file' 2010-06-27 12:07:55 -07:00
check-attr.c
check-ref-format.c Allow "check-ref-format --branch" from subdirectory 2010-08-06 10:01:45 -07:00
checkout-index.c
checkout.c Merge branch 'gv/portable' 2010-06-21 06:02:44 -07:00
clean.c
clone.c Merge branch 'ph/clone-message-reword' 2010-06-18 11:16:53 -07:00
commit-tree.c
commit.c commit: remove full stop from usage help for -u 2010-07-27 09:44:17 -07:00
config.c
count-objects.c
describe.c Merge branch 'sp/maint-describe-tiebreak-with-tagger-date' into maint 2010-06-16 16:21:15 -07:00
diff-files.c
diff-index.c
diff-tree.c
diff.c Merge branch 'jc/diff-merge-base-multi' 2010-07-16 15:45:35 -07:00
fast-export.c string_list: Fix argument order for string_list_append 2010-06-27 10:06:52 -07:00
fetch-pack.c
fetch.c Clarify help message when no remote is specified in fetch/pull. 2010-07-27 09:12:23 -07:00
fmt-merge-msg.c Merge branch 'jp/string-list-api-cleanup' 2010-06-30 11:55:38 -07:00
for-each-ref.c Merge branch 'maint' 2010-06-07 22:15:31 -07:00
fsck.c
gc.c
grep.c Merge branch 'jn/grep-open' 2010-07-15 12:07:18 -07:00
hash-object.c
help.c Cast execl*() NULL sentinels to (char *) 2010-07-25 23:14:18 -07:00
index-pack.c Merge branch 'np/index-pack-memsave' into maint 2010-06-16 16:22:23 -07:00
init-db.c handle "git --bare init <dir>" properly 2010-05-10 11:25:37 -07:00
log.c Merge branch 'ar/decorate-color' 2010-06-30 11:55:40 -07:00
ls-files.c Merge branch 'jp/string-list-api-cleanup' 2010-06-30 11:55:38 -07:00
ls-remote.c
ls-tree.c
mailinfo.c enums: omit trailing comma for portability 2010-05-31 16:59:27 -07:00
mailsplit.c string_list: Fix argument order for string_list_insert 2010-06-27 10:06:51 -07:00
merge-base.c
merge-file.c Merge branch 'rs/diff-no-minimal' into maint 2010-06-21 05:38:50 -07:00
merge-index.c
merge-ours.c
merge-recursive.c
merge-tree.c merge-tree: fix where two branches share no changes 2010-07-14 12:56:49 -07:00
merge.c Merge branch 'tc/merge-m-log' 2010-06-18 11:16:54 -07:00
mktag.c
mktree.c
mv.c string_list: Fix argument order for string_list_insert 2010-06-27 10:06:51 -07:00
name-rev.c
notes.c git notes merge: --commit should fail if underlying notes ref has moved 2010-11-17 13:22:49 -08:00
pack-objects.c Merge branch 'np/malloc-threading' into maint 2010-06-16 16:21:06 -07:00
pack-redundant.c
pack-refs.c
patch-id.c
prune-packed.c
prune.c
push.c
read-tree.c Merge remote branch 'ko/master' into jc/read-tree-cache-tree-fix 2010-07-08 18:55:50 -07:00
receive-pack.c Merge branch 'tr/receive-pack-aliased-update-fix' into maint 2010-07-07 10:25:15 -07:00
reflog.c Merge branch 'jc/maint-no-reflog-expire-unreach-for-head' 2010-05-21 04:02:18 -07:00
remote.c Merge branch 'jp/string-list-api-cleanup' 2010-06-30 11:55:38 -07:00
replace.c
rerere.c Merge branch 'js/merge-rr-fix' 2010-07-15 12:08:36 -07:00
reset.c
rev-list.c rev-list: introduce --count option 2010-06-12 09:39:06 -07:00
rev-parse.c Merge branch 'maint' 2010-07-07 11:18:26 -07:00
revert.c revert: do not rebuild argv on heap 2010-06-29 10:36:13 -07:00
rm.c
send-pack.c
shortlog.c string_list: Fix argument order for string_list_append 2010-06-27 10:06:52 -07:00
show-branch.c show-branch: use DEFAULT_ABBREV instead of 7 2010-05-25 09:48:49 -07:00
show-ref.c string_list: Fix argument order for string_list_insert 2010-06-27 10:06:51 -07:00
stripspace.c
symbolic-ref.c
tag.c
tar-tree.c
unpack-file.c
unpack-objects.c
update-index.c
update-ref.c
update-server-info.c
upload-archive.c
var.c
verify-pack.c
verify-tag.c
write-tree.c