summaryrefslogtreecommitdiff
path: root/commit.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-11-07 21:26:22 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-11-08 18:36:53 (GMT)
commitae8e4c9ce10ea9439a88b79a40aeff4696d40416 (patch)
treeba5ca6899912fda76ce6a9c21794242a356919e3 /commit.h
parent895680f044ebe9df600e6c9e042d40d9d953bc9b (diff)
downloadgit-ae8e4c9ce10ea9439a88b79a40aeff4696d40416.zip
git-ae8e4c9ce10ea9439a88b79a40aeff4696d40416.tar.gz
git-ae8e4c9ce10ea9439a88b79a40aeff4696d40416.tar.bz2
merge: make usage of commit->util more extensible
The merge-recursive code uses the commit->util field directly to annotate the commit objects given from the command line, i.e. the remote heads to be merged, with a single string to be used to describe it in its trace messages and conflict markers. Correct this short-signtedness by redefining the field to be a pointer to a structure "struct merge_remote_desc" that later enhancements can add more information. Store the original objects we were told to merge in a field "obj" in this struct, so that we can recover the tag we were told to merge. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit.h')
-rw-r--r--commit.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/commit.h b/commit.h
index 009b113..5b57eab 100644
--- a/commit.h
+++ b/commit.h
@@ -185,4 +185,17 @@ extern int commit_tree(const char *msg, unsigned char *tree,
struct commit_list *parents, unsigned char *ret,
const char *author);
+struct merge_remote_desc {
+ struct object *obj; /* the named object, could be a tag */
+ const char *name;
+};
+#define merge_remote_util(commit) ((struct merge_remote_desc *)((commit)->util))
+
+/*
+ * Given "name" from the command line to merge, find the commit object
+ * and return it, while storing merge_remote_desc in its ->util field,
+ * to allow callers to tell if we are told to merge a tag.
+ */
+struct commit *get_merge_parent(const char *name);
+
#endif /* COMMIT_H */