summaryrefslogtreecommitdiff
path: root/commit.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2007-04-12 21:04:27 -0700
committerJunio C Hamano <junkio@cox.net>2007-04-12 21:04:27 -0700
commitd016a896d4a58a53dbb98cd85ebd033771413079 (patch)
tree0ac950f5bd9529ef1628246bfb14ae72bdfcb242 /commit.c
parentcd8d918601e28d3aa86b63eeea223b86d71ce1b6 (diff)
parent55a643ed1b9b9af4d3bd9dc934dfccd142d1c632 (diff)
downloadgit-d016a896d4a58a53dbb98cd85ebd033771413079.tar.gz
Merge branch 'jc/cherry'
* jc/cherry: Documentation: --cherry-pick git-log --cherry-pick A...B Refactor patch-id filtering out of git-cherry and git-format-patch. Add %m to '--pretty=format:'
Diffstat (limited to 'commit.c')
-rw-r--r--commit.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/commit.c b/commit.c
index 754d1b8a0b..952095faa7 100644
--- a/commit.c
+++ b/commit.c
@@ -4,6 +4,8 @@
#include "pkt-line.h"
#include "utf8.h"
#include "interpolate.h"
+#include "diff.h"
+#include "revision.h"
int save_commit_buffer = 1;
@@ -808,7 +810,8 @@ static long format_commit_message(const struct commit *commit,
{ "%Cgreen" }, /* green */
{ "%Cblue" }, /* blue */
{ "%Creset" }, /* reset color */
- { "%n" } /* newline */
+ { "%n" }, /* newline */
+ { "%m" }, /* left/right/bottom */
};
enum interp_index {
IHASH = 0, IHASH_ABBREV,
@@ -824,14 +827,15 @@ static long format_commit_message(const struct commit *commit,
ISUBJECT,
IBODY,
IRED, IGREEN, IBLUE, IRESET_COLOR,
- INEWLINE
+ INEWLINE,
+ ILEFT_RIGHT,
};
struct commit_list *p;
char parents[1024];
int i;
enum { HEADER, SUBJECT, BODY } state;
- if (INEWLINE + 1 != ARRAY_SIZE(table))
+ if (ILEFT_RIGHT + 1 != ARRAY_SIZE(table))
die("invalid interp table!");
/* these are independent of the commit */
@@ -852,6 +856,12 @@ static long format_commit_message(const struct commit *commit,
interp_set_entry(table, ITREE_ABBREV,
find_unique_abbrev(commit->tree->object.sha1,
DEFAULT_ABBREV));
+ interp_set_entry(table, ILEFT_RIGHT,
+ (commit->object.flags & BOUNDARY)
+ ? "-"
+ : (commit->object.flags & SYMMETRIC_LEFT)
+ ? "<"
+ : ">");
parents[1] = 0;
for (i = 0, p = commit->parents;