author | Junio C Hamano <gitster@pobox.com> | |
Sat, 3 Apr 2010 19:28:41 +0000 (12:28 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 3 Apr 2010 19:28:41 +0000 (12:28 -0700) |
* jn/merge-diff3-label:
merge-recursive: add a label for ancestor
cherry-pick, revert: add a label for ancestor
revert: clarify label on conflict hunks
compat: add mempcpy()
checkout -m --conflict=diff3: add a label for ancestor
merge_trees(): add ancestor label parameter for diff3-style output
merge_file(): add comment explaining behavior wrt conflict style
checkout --conflict=diff3: add a label for ancestor
ll_merge(): add ancestor label parameter for diff3-style output
merge-file --diff3: add a label for ancestor
xdl_merge(): move file1 and file2 labels to xmparam structure
xdl_merge(): add optional ancestor label to diff3-style output
tests: document cherry-pick behavior in face of conflicts
tests: document format of conflicts from checkout -m
Conflicts:
builtin/revert.c
merge-recursive: add a label for ancestor
cherry-pick, revert: add a label for ancestor
revert: clarify label on conflict hunks
compat: add mempcpy()
checkout -m --conflict=diff3: add a label for ancestor
merge_trees(): add ancestor label parameter for diff3-style output
merge_file(): add comment explaining behavior wrt conflict style
checkout --conflict=diff3: add a label for ancestor
ll_merge(): add ancestor label parameter for diff3-style output
merge-file --diff3: add a label for ancestor
xdl_merge(): move file1 and file2 labels to xmparam structure
xdl_merge(): add optional ancestor label to diff3-style output
tests: document cherry-pick behavior in face of conflicts
tests: document format of conflicts from checkout -m
Conflicts:
builtin/revert.c
1 | 2 | |||
---|---|---|---|---|
builtin/revert.c | patch | | diff1 | | diff2 | | blob | history |
git-compat-util.h | patch | | diff1 | | diff2 | | blob | history |
diff --cc builtin/revert.c
index 9a3c14c329713f16d14147b81a4b8031028a4f82,1ddfac15b55a1b0bed7c7e359cb952749225a4f2..778a56eb512edde3aac6c2a4d668cc73ab3d8460
--- 1/builtin/revert.c
--- 2/builtin/revert.c
+++ b/builtin/revert.c
{
unsigned char head[20];
struct commit *base, *next, *parent;
+ const char *base_label, *next_label;
int i, index_fd, clean;
- char *oneline, *reencoded_message = NULL;
- const char *message, *encoding;
+ struct commit_message msg = { NULL, NULL, NULL, NULL, NULL };
-
- char *defmsg = git_pathdup("MERGE_MSG");
+ char *defmsg = NULL;
struct merge_options o;
struct tree *result, *next_tree, *base_tree, *head_tree;
static struct lock_file index_lock;
else
parent = commit->parents->item;
- if (!(message = commit->buffer))
- die ("Cannot get commit message for %s",
- sha1_to_hex(commit->object.sha1));
-
+ if (allow_ff && !hashcmp(parent->object.sha1, head))
+ return fast_forward_to(commit->object.sha1, head);
+
if (parent && parse_commit(parent) < 0)
die("%s: cannot parse parent commit %s",
me, sha1_to_hex(parent->object.sha1));
msg_fd = hold_lock_file_for_update(&msg_file, defmsg,
LOCK_DIE_ON_ERROR);
- encoding = get_encoding(message);
- if (!encoding)
- encoding = "UTF-8";
- if (!git_commit_encoding)
- git_commit_encoding = "UTF-8";
- if ((reencoded_message = reencode_string(message,
- git_commit_encoding, encoding)))
- message = reencoded_message;
-
- oneline = get_oneline(message);
-
+ index_fd = hold_locked_index(&index_lock, 1);
+
if (action == REVERT) {
- char *oneline_body = strchr(oneline, ' ');
-
base = commit;
+ base_label = msg.label;
next = parent;
+ next_label = msg.parent_label;
add_to_msg("Revert \"");
- add_to_msg(oneline_body + 1);
+ add_to_msg(msg.subject);
add_to_msg("\"\n\nThis reverts commit ");
add_to_msg(sha1_to_hex(commit->object.sha1));
diff --cc git-compat-util.h
Simple merge