[PATCH 0/3] Blame UI

John Keeping john at keeping.me.uk
Wed Aug 12 15:03:33 CEST 2015

This is an attempt at adding "blame" support to CGit.  Because git.git
doesn't include the blame implementation in libgit.a, I decided to
simply invoke git-blame(1) and parse its porcelain output.  I don't
think the result is too hideous (although I do perhaps need to extract
some helper functions from process_blame()) and given how expensive
blame is as an operation I can live with the overhead of an extra

The UI is inspired by Gitweb's blame output (e.g. [1]).  I did want to
find a way to add a "blame parent" link, the implementation of which is
relatively straightforward, but I failed to invent a format I was happy
with (concise enough to keep the column narrow and also avoiding
confusion with Git's existing ref format).  You can still manage to
blame the parent by following links to the commit's parent and then
blaming the file there.

[1] http://repo.or.cz/w/cgit.git/blame/HEAD:/cgit.c

John Keeping (3):
  ui-blame: add blame UI
  ui-shared: add cgit_blame_link()
  ui-tree: generate blame links

 cgit.c       |   4 +-
 cgit.css     |   4 ++
 cgit.h       |   3 +
 cgit.mk      |   1 +
 cgitrc.5.txt |   4 ++
 cmd.c        |   7 +++
 ui-blame.c   | 202 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 ui-blame.h   |   6 ++
 ui-shared.c  |  40 ++++++++++++
 ui-shared.h  |   3 +
 ui-tree.c    |   9 +++
 11 files changed, 282 insertions(+), 1 deletion(-)
 create mode 100644 ui-blame.c
 create mode 100644 ui-blame.h


More information about the CGit mailing list