summaryrefslogtreecommitdiff
path: root/graph.h
AgeCommit message (Collapse)Author
2019-11-18graph: move doc to graph.h and graph.cHeba Waly
Move the documentation from Documentation/technical/api-history-graph.txt to graph.h and graph.c as it's easier for the developers to find the usage information beside the code instead of looking for it in another doc file. The graph library was already well documented, so few comments were added to both graph.h and graph.c Also documentation/technical/api-history-graph.txt is removed because the information it has is now redundant and it'll be hard to keep it up to date and synchronized with the documentation in the header file. Signed-off-by: Heba Waly <heba.waly@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-09-01graph: add support for --line-prefix on all graph-aware outputJacob Keller
Add an extension to git-diff and git-log (and any other graph-aware displayable output) such that "--line-prefix=<string>" will print the additional line-prefix on every line of output. To make this work, we have to fix a few bugs in the graph API that force graph_show_commit_msg to be used only when you have a valid graph. Additionally, we extend the default_diff_output_prefix handler to work even when no graph is enabled. This is somewhat of a hack on top of the graph API, but I think it should be acceptable here. This will be used by a future extension of submodule display which displays the submodule diff as the actual diff between the pre and post commit in the submodule project. Add some tests for both git-log and git-diff to ensure that the prefix is honored correctly. Signed-off-by: Jacob Keller <jacob.keller@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-06-16pretty: pass graph width to pretty formatting for use in '%>|(N)'Josef Kufner
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>
2013-03-04Revert "graph.c: mark private file-scope symbols as static"John Keeping
This reverts commit ba35480439d05b8f6cca50527072194fe3278bbb. CGit uses these symbols to output the correct HTML around graph elements. Making these symbols private means that CGit cannot be updated to use Git 1.8.0 or newer, so let's not do that. On top of the revert, also add comments so that we avoid reintroducing this problem in the future and suggest to those modifying this API that they might want to discuss it with the CGit developers. Signed-off-by: John Keeping <john@keeping.me.uk> Acked-by: Jason A. Donenfeld <Jason@zx2c4.com> Acked-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-09-16graph.c: mark private file-scope symbols as staticJunio C Hamano
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-13Enable custom schemes for column colors in the graph APIJohan Herland
Currently, the graph code is hardcoded to use ANSI color escapes for coloring the column characters in the generated graphs. This patch allows a custom scheme of colors to be set at runtime, allowing different types of color escapes to be used. A new function - graph_set_column_colors() - is added to the graph.h API, which allows a custom column_colors array (and column_colors_max value) to replace the builtin ANSI array (and _max value). The new function - if used - must be called before graph_init() is called. Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-07-13Make graph_next_line() available in the graph.h APIJohan Herland
In order to successfully use the graph API from a context other than the stdout/command-line scenario (where the graph_show_* functions are suitable), we need direct access to graph_next_line(), to drive the graph drawing process. Signed-off-by: Johan Herland <johan@herland.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2009-11-20Documentation: undocument gc'd function graph_release()Greg Price
graph_release() was removed in 064bfbd. Cut it from the API documentation and a comment. Signed-off-by: Greg Price <price@ksplice.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-09-25graph.c: make many functions staticNanako Shiraishi
These function are not used anywhere. Also removes graph_release() that is never called. Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-05-25log --graph --left-right: show left/right information in place of '*'Adam Simpkins
With the --graph option, the graph already outputs 'o' instead of '*' for boundary commits. Make it emit '<' or '>' when --left-right is specified. (This change also disables the '^' prefix for UNINTERESTING commits. The graph code currently doesn't print anything special for these commits, since it assumes no UNINTERESTING, non-BOUNDARY commits are displayed. This is potentially a bug if UNINTERESTING non-BOUNDARY commits can actually be displayed via some code path.) [jc: squashed the left-right change from Dscho and Adam's fixup into one] Signed-off-by: Adam Simpkins <adam@adamsimpkins.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-05-06Add history graph APIAdam Simpkins
This new API allows the commit history to be displayed as a text-based graphical representation. Signed-off-by: Adam Simpkins <adam@adamsimpkins.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>