aboutsummaryrefslogtreecommitdiff
path: root/pretty.c
diff options
context:
space:
mode:
authorJosef Kufner <josef@kufner.cz>2016-06-16 20:18:37 +0700
committerJunio C Hamano <gitster@pobox.com>2016-06-16 11:43:36 -0700
commit3ad87c807c2b6cbfbdfb2c78412781ecc7db593d (patch)
treee7b1ea6c6d9fa662be89d963317532a5e9663c63 /pretty.c
parent05219a1276341e72d8082d76b7f5ed394b7437a4 (diff)
downloadgit-3ad87c807c2b6cbfbdfb2c78412781ecc7db593d.tar.gz
git-3ad87c807c2b6cbfbdfb2c78412781ecc7db593d.tar.xz
pretty: pass graph width to pretty formatting for use in '%>|(N)'
Pass graph width to pretty formatting, to make N in '%>|(N)' include columns consumed by graph rendered when --graph option is in use. For example, in the output of git log --all --graph --pretty='format: [%>|(20)%h] %ar%d' this change will make all commit hashes align at 20th column from the edge of the terminal, not from the edge of the graph. Signed-off-by: Josef Kufner <josef@kufner.cz> Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pretty.c')
-rw-r--r--pretty.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/pretty.c b/pretty.c
index 87c44971a..4f33b09a2 100644
--- a/pretty.c
+++ b/pretty.c
@@ -1299,6 +1299,7 @@ static size_t format_and_pad_commit(struct strbuf *sb, /* in UTF-8 */
if (!start)
start = sb->buf;
occupied = utf8_strnwidth(start, -1, 1);
+ occupied += c->pretty_ctx->graph_width;
padding = (-padding) - occupied;
}
while (1) {