summaryrefslogtreecommitdiff
path: root/graph.c
diff options
context:
space:
mode:
authorJosef Kufner <josef@kufner.cz>2015-09-12 01:25:11 +0200
committerJunio C Hamano <gitster@pobox.com>2015-09-14 13:02:47 -0700
commitc03fd1bd3a84a1923ef130f20ab0c01ec3d8c742 (patch)
tree3dac1ec6c496a1323ac927fe4fdb3747cb13de93 /graph.c
parent441c4a40173fe1ee8a5c0094e587dfc47e2a6460 (diff)
downloadgit-jk/graph-format-padding.tar.gz
pretty: pass graph width to pretty formatting for use in '%>|(N)'jk/graph-format-padding
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>
Diffstat (limited to 'graph.c')
-rw-r--r--graph.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/graph.c b/graph.c
index c25a09a8fd..48024113a6 100644
--- a/graph.c
+++ b/graph.c
@@ -671,6 +671,13 @@ static void graph_output_padding_line(struct git_graph *graph,
graph_pad_horizontally(graph, sb, graph->num_new_columns * 2);
}
+
+int graph_width(struct git_graph *graph)
+{
+ return graph->width;
+}
+
+
static void graph_output_skip_line(struct git_graph *graph, struct strbuf *sb)
{
/*