summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 577ed5c)
raw | patch | inline | side by side (parent: 577ed5c)
author | Junio C Hamano <junkio@cox.net> | |
Sat, 16 Dec 2006 23:31:25 +0000 (15:31 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sun, 17 Dec 2006 18:35:28 +0000 (10:35 -0800) |
This makes reviewing
git log --left-right --merge --no-merges -p
a lot more pleasant.
Signed-off-by: Junio C Hamano <junkio@cox.net>
git log --left-right --merge --no-merges -p
a lot more pleasant.
Signed-off-by: Junio C Hamano <junkio@cox.net>
builtin-rev-list.c | patch | blob | history | |
log-tree.c | patch | blob | history | |
revision.c | patch | blob | history | |
revision.h | patch | blob | history |
diff --git a/builtin-rev-list.c b/builtin-rev-list.c
index 4364035e154c830f7c5b2feead804b2bd33fffae..1bb3a06680194ce5855185ad1a1c7e39eeebba94 100644 (file)
--- a/builtin-rev-list.c
+++ b/builtin-rev-list.c
static int show_timestamp;
static int hdr_termination;
static const char *header_prefix;
-static int show_left_right;
static void show_commit(struct commit *commit)
{
fputs(header_prefix, stdout);
if (commit->object.flags & BOUNDARY)
putchar('-');
- else if (show_left_right) {
+ else if (revs.left_right) {
if (commit->object.flags & SYMMETRIC_LEFT)
putchar('<');
else
bisect_list = 1;
continue;
}
- if (!strcmp(arg, "--left-right")) {
- show_left_right = 1;
- continue;
- }
if (!strcmp(arg, "--stdin")) {
if (read_from_stdin++)
die("--stdin given twice?");
diff --git a/log-tree.c b/log-tree.c
index 8787df5cc647dda24f09b077276cbe0aa054fc47..35be33aaf73e0b53cb9ece09bba5f1e12de4b99d 100644 (file)
--- a/log-tree.c
+++ b/log-tree.c
opt->loginfo = NULL;
if (!opt->verbose_header) {
+ if (opt->left_right) {
+ if (commit->object.flags & BOUNDARY)
+ putchar('-');
+ else if (commit->object.flags & SYMMETRIC_LEFT)
+ putchar('<');
+ else
+ putchar('>');
+ }
fputs(diff_unique_abbrev(commit->object.sha1, abbrev_commit), stdout);
if (opt->parents)
show_parents(commit, abbrev_commit);
opt->diffopt.stat_sep = buffer;
}
} else {
- printf("%s%s%s",
- diff_get_color(opt->diffopt.color_diff, DIFF_COMMIT),
- opt->commit_format == CMIT_FMT_ONELINE ? "" : "commit ",
- diff_unique_abbrev(commit->object.sha1, abbrev_commit));
+ fputs(diff_get_color(opt->diffopt.color_diff, DIFF_COMMIT),
+ stdout);
+ if (opt->commit_format != CMIT_FMT_ONELINE)
+ fputs("commit ", stdout);
+ if (opt->left_right) {
+ if (commit->object.flags & BOUNDARY)
+ putchar('-');
+ else if (commit->object.flags & SYMMETRIC_LEFT)
+ putchar('<');
+ else
+ putchar('>');
+ }
+ fputs(diff_unique_abbrev(commit->object.sha1, abbrev_commit),
+ stdout);
if (opt->parents)
show_parents(commit, abbrev_commit);
if (parent)
diff --git a/revision.c b/revision.c
index 3d989c3edf1e089d4ee9c3f4f439b1e77e2aedde..d84f46e5a663a61c05354abbffaf05feee991cb6 100644 (file)
--- a/revision.c
+++ b/revision.c
@@ -853,6 +853,10 @@ int setup_revisions(int argc, const char **argv, struct rev_info *revs, const ch
revs->boundary = 1;
continue;
}
+ if (!strcmp(arg, "--left-right")) {
+ revs->left_right = 1;
+ continue;
+ }
if (!strcmp(arg, "--objects")) {
revs->tag_objects = 1;
revs->tree_objects = 1;
diff --git a/revision.h b/revision.h
index f92a4d43752e02a9d1ced62b3c3c35943cb72965..4585463a44c9faecdcdf4454b735b1e4ba1335aa 100644 (file)
--- a/revision.h
+++ b/revision.h
limited:1,
unpacked:1, /* see also ignore_packed below */
boundary:1,
+ left_right:1,
parents:1;
/* Diff flags */