List for cgit developers and users
 help / color / mirror / Atom feed
From: john at keeping.me.uk (John Keeping)
Subject: [PATCH 0/3] Blame UI
Date: Wed, 12 Aug 2015 14:03:33 +0100	[thread overview]
Message-ID: <cover.1439384224.git.john@keeping.me.uk> (raw)

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
process.

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

-- 
2.5.0.466.g9af26fa



             reply	other threads:[~2015-08-12 13:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-12 13:03 john [this message]
2015-08-12 13:03 ` [PATCH 1/3] ui-blame: add blame UI john
2015-08-12 13:03 ` [PATCH 2/3] ui-shared: add cgit_blame_link() john
2015-08-12 13:03 ` [PATCH 3/3] ui-tree: generate blame links john
2015-08-12 13:44 ` [PATCH 0/3] Blame UI Jason
2015-08-12 15:02   ` john
2015-08-12 15:07     ` Jason
2015-08-12 15:26       ` john

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=cover.1439384224.git.john@keeping.me.uk \
    --to=cgit@lists.zx2c4.com \
    /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).