aboutsummaryrefslogtreecommitdiff
path: root/commit.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-11-07 16:21:32 -0800
committerJunio C Hamano <gitster@pobox.com>2011-11-09 10:28:04 -0800
commit5231c633f2e54723d53a8cd928d9bc98b39dc35f (patch)
treeb7f624f3742c4baf285d1e59ee1a1dbab1198fee /commit.h
parent274a5c06d525da8c9720ae60454fba6779523c52 (diff)
downloadgit-5231c633f2e54723d53a8cd928d9bc98b39dc35f.tar.gz
git-5231c633f2e54723d53a8cd928d9bc98b39dc35f.tar.xz
commit: copy merged signed tags to headers of merge commit
Now MERGE_HEAD records the tag objects without peeling, we could record the result of manual conflict resolution via "git commit" without losing the tag information. Introduce a new "mergetag" multi-line header field to the commit object, and use it to store the entire contents of each signed tag merged. A commit header that has a multi-line payload begins with the header tag (e.g. "mergetag" in this case), SP, the first line of payload, LF, and all the remaining lines have a SP inserted at the beginning. In hindsight, it would have been better to make "merge --continue" as the way to continue from such an interrupted merge, not "commit", but this is a backward compatibility baggage we would need to carry around for now. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit.h')
-rw-r--r--commit.h21
1 files changed, 19 insertions, 2 deletions
diff --git a/commit.h b/commit.h
index 5b57eab57..c1a723ecd 100644
--- a/commit.h
+++ b/commit.h
@@ -181,9 +181,26 @@ static inline int single_parent(struct commit *commit)
struct commit_list *reduce_heads(struct commit_list *heads);
+struct commit_extra_header {
+ struct commit_extra_header *next;
+ char *key;
+ char *value;
+ size_t len;
+};
+
+extern void append_merge_tag_headers(struct commit_list *parents,
+ struct commit_extra_header ***tail);
+
extern int commit_tree(const char *msg, unsigned char *tree,
- struct commit_list *parents, unsigned char *ret,
- const char *author);
+ struct commit_list *parents, unsigned char *ret,
+ const char *author);
+
+extern int commit_tree_extended(const char *msg, unsigned char *tree,
+ struct commit_list *parents, unsigned char *ret,
+ const char *author,
+ struct commit_extra_header *);
+
+extern void free_commit_extra_headers(struct commit_extra_header *extra);
struct merge_remote_desc {
struct object *obj; /* the named object, could be a tag */