all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* vc-annotate / magit-blame considerations
@ 2015-04-26 11:20 Yuri D'Elia
  2015-04-28 13:28 ` Jacob Gerlach
  0 siblings, 1 reply; 4+ messages in thread
From: Yuri D'Elia @ 2015-04-26 11:20 UTC (permalink / raw)
  To: help-gnu-emacs

For files with just a few block changes, I do like the output of
magit-blame, as it shows the editing chunks more easily.

But in reality, in mature projects contiguous changes are often only 1-2
lines long, making the interspersed annotation a major distraction. As a
result, I never actually use magit-blame.

I've been using vc-annotate with relative success, but with git commit
hashes&all, the side annotation is soo long I need the space of the
entire screen to decently read the content of the buffer as well.

I couldn't find an easy way to customize the annotation. It would make
sense to me to be able to filter the available info using a function
and/or a format. The current option of hiding all annotations is not
terribly useful, since you clearly want *some* annotation if you're
using vc-annotate in the first place.

Suggestions?




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: vc-annotate / magit-blame considerations
  2015-04-26 11:20 vc-annotate / magit-blame considerations Yuri D'Elia
@ 2015-04-28 13:28 ` Jacob Gerlach
  2015-04-28 14:12   ` Yuri D'Elia
  0 siblings, 1 reply; 4+ messages in thread
From: Jacob Gerlach @ 2015-04-28 13:28 UTC (permalink / raw)
  To: Yuri D'Elia, help-gnu-emacs

Hello,

On Sun, Apr 26, 2015 at 7:21 AM Yuri D'Elia <wavexx@thregr.org> wrote:
>
> I couldn't find an easy way to customize the annotation. It would make
> sense to me to be able to filter the available info using a function
> and/or a format. The current option of hiding all annotations is not
> terribly useful, since you clearly want *some* annotation if you're
> using vc-annotate in the first place.

It's looks like the format is hard coded in vc-git-annotate-command.
If you can find a set of arguments to git blame (for example, -s to
hide author and date or --abbrev=n to truncate the SHA1) that produces
the format you'd like, you could redefine this function with the
arguments you prefer. It's a hack, but it does help to make lines in
the annotate buffer a bit shorter. Unfortunately, the date is parsed
to fontify the annotate buffer, so you can't use -s if you want to
keep the color coding.

There is probably a better solution using invisibility specs, but it
looks like that might imply some deep changes to the entire vc system.

Regards,
Jake



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: vc-annotate / magit-blame considerations
  2015-04-28 13:28 ` Jacob Gerlach
@ 2015-04-28 14:12   ` Yuri D'Elia
  2015-04-28 15:58     ` Jacob Gerlach
  0 siblings, 1 reply; 4+ messages in thread
From: Yuri D'Elia @ 2015-04-28 14:12 UTC (permalink / raw)
  To: help-gnu-emacs

On 04/28/2015 03:28 PM, Jacob Gerlach wrote:
>> I couldn't find an easy way to customize the annotation. It would make
>> sense to me to be able to filter the available info using a function
>> and/or a format. The current option of hiding all annotations is not
>> terribly useful, since you clearly want *some* annotation if you're
>> using vc-annotate in the first place.
> 
> It's looks like the format is hard coded in vc-git-annotate-command.
> If you can find a set of arguments to git blame (for example, -s to
> hide author and date or --abbrev=n to truncate the SHA1) that produces
> the format you'd like, you could redefine this function with the
> arguments you prefer. It's a hack, but it does help to make lines in
> the annotate buffer a bit shorter. Unfortunately, the date is parsed
> to fontify the annotate buffer, so you can't use -s if you want to
> keep the color coding.

I actually disabled color-coding. First, I feel it should have been done
on the annotation, not on the buffer. Font-locking on the buffer is too
important. On top of that, I also didn't find age coloring useful. I
customized a bit the ranges, but in practice for any mature project the
age of the changeset is irrelevant. Color-coding the changeset id using
a high-contrast palette is much more useful, as you want to see lines
part of the same commit even when they're not contiguous.

> There is probably a better solution using invisibility specs, but it
> looks like that might imply some deep changes to the entire vc system.

I was looking a bit into it, but yeah, it looks like that either
changing magit-blame or changing vc-annotate requires non-trivial rework.





^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: vc-annotate / magit-blame considerations
  2015-04-28 14:12   ` Yuri D'Elia
@ 2015-04-28 15:58     ` Jacob Gerlach
  0 siblings, 0 replies; 4+ messages in thread
From: Jacob Gerlach @ 2015-04-28 15:58 UTC (permalink / raw)
  Cc: help-gnu-emacs

On Tue, Apr 28, 2015 at 10:12 AM, Yuri D'Elia <wavexx@thregr.org> wrote:
> I actually disabled color-coding.

Well if you don't need that (and maybe you also don't care about
tracking line across file moves), how does this work for you?

(defun vc-git-annotate-command (file buf &optional rev)
  (let ((name (file-relative-name file)))
    (vc-git-command buf 'async nil "blame" "-s" "--abbrev=1" "--" name)))

Regards,
Jake



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-04-28 15:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-26 11:20 vc-annotate / magit-blame considerations Yuri D'Elia
2015-04-28 13:28 ` Jacob Gerlach
2015-04-28 14:12   ` Yuri D'Elia
2015-04-28 15:58     ` Jacob Gerlach

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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.