From: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
To: git@vger.kernel.org
Cc: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Subject: [PATCH] log --oneline: put decoration at the end of the line
Date: Wed, 19 Sep 2012 18:52:20 +0700 [thread overview]
Message-ID: <1348055540-13774-1-git-send-email-pclouds@gmail.com> (raw)
I find it easier to read "git log --oneline" when the subject lines
align, which they don't when the log is decorated because the
decoration stands before the subject line.
I'm on colored output so moving decoration to the end of line does not
make it harder to recognize refs. What about black-and-white people?
We could right align the decoration if it makes it easier for
the black-and-whites to read (but not to the right edge when the screen
is too wide)
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
log-tree.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/log-tree.c b/log-tree.c
index c894930..c51c942 100644
--- a/log-tree.c
+++ b/log-tree.c
@@ -616,11 +616,12 @@ void show_log(struct rev_info *opt)
printf(" (from %s)",
find_unique_abbrev(parent->object.sha1,
abbrev_commit));
- show_decorations(opt, commit);
- printf("%s", diff_get_color_opt(&opt->diffopt, DIFF_RESET));
if (opt->commit_format == CMIT_FMT_ONELINE) {
+ printf("%s", diff_get_color_opt(&opt->diffopt, DIFF_RESET));
putchar(' ');
} else {
+ show_decorations(opt, commit);
+ printf("%s", diff_get_color_opt(&opt->diffopt, DIFF_RESET));
putchar('\n');
graph_show_oneline(opt->graph);
}
@@ -682,6 +683,10 @@ void show_log(struct rev_info *opt)
graph_show_commit_msg(opt->graph, &msgbuf);
else
fwrite(msgbuf.buf, sizeof(char), msgbuf.len, stdout);
+ if (opt->commit_format == CMIT_FMT_ONELINE) {
+ show_decorations(opt, commit);
+ printf("%s", diff_get_color_opt(&opt->diffopt, DIFF_RESET));
+ }
if (opt->use_terminator) {
if (!opt->missing_newline)
graph_show_padding(opt->graph);
--
1.7.12.403.gce5cf6f.dirty
next reply other threads:[~2012-09-19 11:52 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-19 11:52 Nguyễn Thái Ngọc Duy [this message]
2012-09-19 18:20 ` [PATCH] log --oneline: put decoration at the end of the line Jeff King
2012-09-19 19:57 ` Junio C Hamano
2012-09-19 20:05 ` Jeff King
2012-09-19 23:34 ` Junio C Hamano
2012-09-19 23:42 ` Jeff King
2012-09-20 0:18 ` Junio C Hamano
2012-09-20 10:43 ` Nguyen Thai Ngoc Duy
2012-09-20 12:26 ` [PATCH 0/2] New pretty format color specifiers %C+ and %C- Nguyễn Thái Ngọc Duy
2012-09-20 12:26 ` [PATCH 1/2] pretty: share code between format_decoration and show_decorations Nguyễn Thái Ngọc Duy
2012-09-20 12:26 ` [PATCH 2/2] pretty: support placeholders %C+ and %C- Nguyễn Thái Ngọc Duy
2012-09-20 14:38 ` [PATCH 3/2] pretty: support right alignment Nguyen Thai Ngoc Duy
2012-09-20 16:40 ` Junio C Hamano
2012-09-21 8:55 ` Nguyen Thai Ngoc Duy
2012-09-21 17:46 ` Junio C Hamano
2012-09-23 8:17 ` Junio C Hamano
2012-09-25 0:27 ` Jeff King
2012-09-21 13:03 ` Nguyen Thai Ngoc Duy
2012-09-20 16:47 ` [PATCH 2/2] pretty: support placeholders %C+ and %C- Junio C Hamano
2012-09-20 17:47 ` Junio C Hamano
2012-09-21 8:36 ` Nguyen Thai Ngoc Duy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1348055540-13774-1-git-send-email-pclouds@gmail.com \
--to=pclouds@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).