From: Junio C Hamano <gitster@pobox.com>
To: Alex Bennee <kernel-hacker@bennee.com>
Cc: git@vger.kernel.org
Subject: Re: [RFC PATCH] Implement vc-git-annotate-show-diff-revision-at-line for emacs vc-git
Date: Fri, 22 Feb 2008 12:51:37 -0800 [thread overview]
Message-ID: <7vbq6890km.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <1203706693.7552.56.camel@alexjb-desktop.transitives.com> (Alex Bennee's message of "Fri, 22 Feb 2008 18:58:13 +0000")
Alex Bennee <kernel-hacker@bennee.com> writes:
> +(defun vc-git-annotate-extract-revision-at-line ()
> + (save-excursion
> + (move-beginning-of-line 1)
> + (and (looking-at "[0-9a-f]+")
> + (buffer-substring (match-beginning 0) (match-end 0)))))
Does this grab the commit object name from the annotation
of a _full_ file? How is the annotation done? With "blame"
without frills?
It may be interesting to run:
git blame -w -n -f -C -- $path
which would give you the code movement (ignoring whitespace
changes) across files, so that you can view where the line
really originated from.
You can also throw in -L line range limiter like this:
git blame -L$lineno-10,+20 -w -n -f -C -- $path
which would limit the output to lines around the current line,
and that would be slightly less expensive than annotating the
whole file, if you do this on-demand.
E.g.
$ git blame -L48,+20 -w -n -f -C -- block/blk-exec.c
would give you something like:
165125e1 block/ll_rw_blk.c 2585 (Jens Axboe 2007-07-2...
f1970baf drivers/block/ll_rw_blk.c 2255 (James Bottomley 2005-06-2...
8ffdc655 block/ll_rw_blk.c 2320 (Tejun Heo 2006-01-0...
f1970baf drivers/block/ll_rw_blk.c 2257 (James Bottomley 2005-06-2...
f1970baf drivers/block/ll_rw_blk.c 2258 (James Bottomley 2005-06-2...
f1970baf drivers/block/ll_rw_blk.c 2259 (James Bottomley 2005-06-2...
f1970baf drivers/block/ll_rw_blk.c 2260 (James Bottomley 2005-06-2...
4aff5e23 block/ll_rw_blk.c 2530 (Jens Axboe 2006-08-1...
f1970baf drivers/block/ll_rw_blk.c 2262 (James Bottomley 2005-06-2...
4c5d0bbd block/ll_rw_blk.c 2480 (Andrew Morton 2006-03-2...
4c5d0bbd block/ll_rw_blk.c 2481 (Andrew Morton 2006-03-2...
4c5d0bbd block/ll_rw_blk.c 2482 (Andrew Morton 2006-03-2...
4c5d0bbd block/ll_rw_blk.c 2483 (Andrew Morton 2006-03-2...
4c5d0bbd block/ll_rw_blk.c 2484 (Andrew Morton 2006-03-2...
f1970baf drivers/block/ll_rw_blk.c 2265 (James Bottomley 2005-06-2...
6e39b69e block/ll_rw_blk.c 2309 (Mike Christie 2005-11-1...
6e39b69e block/ll_rw_blk.c 2310 (Mike Christie 2005-11-1...
637b48c8 drivers/block/ll_rw_blk.c 1872 (Jens Axboe 2004-03-1...
637b48c8 drivers/block/ll_rw_blk.c 1873 (Jens Axboe 2004-03-1...
637b48c8 drivers/block/ll_rw_blk.c 1874 (Jens Axboe 2004-03-1...
prev parent reply other threads:[~2008-02-22 20:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-22 18:58 [RFC PATCH] Implement vc-git-annotate-show-diff-revision-at-line for emacs vc-git Alex Bennee
2008-02-22 20:17 ` Alexandre Julliard
2008-02-23 9:09 ` Alex Bennee
2008-02-22 20:30 ` Junio C Hamano
2008-02-22 20:51 ` Junio C Hamano [this message]
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=7vbq6890km.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=kernel-hacker@bennee.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.