summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fe3b59e)
raw | patch | inline | side by side (parent: fe3b59e)
author | Michael J Gruber <git@drmicha.warpmail.net> | |
Thu, 10 Mar 2011 14:45:03 +0000 (15:45 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 11 Mar 2011 05:55:29 +0000 (21:55 -0800) |
Currently, commit marks (left, right, boundary, cherry) are output right
before the commit sha1, which makes it difficult to copy sha1s. Sample
output for "git log --oneline --cherry":
=049c269 t6007: test rev-list --cherry
Change this to
= 049c269 t6007: test rev-list --cherry
which matches exactly the current output of "git log --graph".
Leave "git rev-list" output as is (no space) so that they do not break.
Adjust "git-svn" which uses "git log --pretty=raw --boundary".
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
before the commit sha1, which makes it difficult to copy sha1s. Sample
output for "git log --oneline --cherry":
=049c269 t6007: test rev-list --cherry
Change this to
= 049c269 t6007: test rev-list --cherry
which matches exactly the current output of "git log --graph".
Leave "git rev-list" output as is (no space) so that they do not break.
Adjust "git-svn" which uses "git log --pretty=raw --boundary".
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-svn.perl | patch | blob | history | |
log-tree.c | patch | blob | history | |
revision.c | patch | blob | history | |
revision.h | patch | blob | history |
diff --git a/git-svn.perl b/git-svn.perl
index 177dd259cd53cde017d73db5ccbecc7ed7dfa573..a5857c1ad45b0462f168a4b3b9249ed8c3cf6e89 100755 (executable)
--- a/git-svn.perl
+++ b/git-svn.perl
my (@k, $c, $d, $stat);
my $esc_color = qr/(?:\033\[(?:(?:\d+;)*\d*)?m)*/;
while (<$log>) {
- if (/^${esc_color}commit -?($::sha1_short)/o) {
+ if (/^${esc_color}commit (- )?($::sha1_short)/o) {
my $cmt = $1;
if ($c && cmt_showable($c) && $c->{r} != $r_last) {
$r_last = $c->{r};
diff --git a/log-tree.c b/log-tree.c
index 12570403110cf579b0b9373fda6f80b34488b2d4..2a1e3a94c910cd74e41303d8b7aefa539817c831 100644 (file)
--- a/log-tree.c
+++ b/log-tree.c
graph_show_commit(opt->graph);
if (!opt->graph)
- fputs(get_revision_mark(opt, commit), stdout);
+ put_revision_mark(opt, commit);
fputs(find_unique_abbrev(commit->object.sha1, abbrev_commit), stdout);
if (opt->print_parents)
show_parents(commit, abbrev_commit);
fputs("commit ", stdout);
if (!opt->graph)
- fputs(get_revision_mark(opt, commit), stdout);
+ put_revision_mark(opt, commit);
fputs(find_unique_abbrev(commit->object.sha1, abbrev_commit),
stdout);
if (opt->print_parents)
diff --git a/revision.c b/revision.c
index 51372f650a4ecbb40c557a916c3f82d7276d9dfb..626f6a23d140d5b0094ac694b92c429bc5a596e3 100644 (file)
--- a/revision.c
+++ b/revision.c
@@ -2302,3 +2302,12 @@ char *get_revision_mark(const struct rev_info *revs, const struct commit *commit
return "+";
return "";
}
+
+void put_revision_mark(const struct rev_info *revs, const struct commit *commit)
+{
+ char *mark = get_revision_mark(revs, commit);
+ if (!strlen(mark))
+ return;
+ fputs(mark, stdout);
+ putchar(' ');
+}
diff --git a/revision.h b/revision.h
index d38f1355d395d7834cfef091c09551bb4cc8b895..1c0abf0f58e3559588cd6522210bc9cf76d43f0f 100644 (file)
--- a/revision.h
+++ b/revision.h
@@ -168,6 +168,7 @@ extern int handle_revision_arg(const char *arg, struct rev_info *revs,int flags,
extern int prepare_revision_walk(struct rev_info *revs);
extern struct commit *get_revision(struct rev_info *revs);
extern char *get_revision_mark(const struct rev_info *revs, const struct commit *commit);
+extern void put_revision_mark(const struct rev_info *revs, const struct commit *commit);
extern void mark_parents_uninteresting(struct commit *commit);
extern void mark_tree_uninteresting(struct tree *tree);