Subject: Re: bug#73232: [PATCH] Allow vc-diff to suggest a default revision in vc-dir

From: Dmitry Gutov <[email-masked]>
Date: Sat, 14 Sep 2024 04:45:42 +0300

Hi Spencer,

On 13/09/2024 19:25, Spencer Baugh via Bug reports for GNU Emacs, the 
Swiss army knife of text editors wrote:
> Concretely this has the effect that for the vc-git and vc-hg backends,
> running C-u M-x vc-root-diff in vc-dir will have the same behavior as
> running C-u M-x vc-root-diff in a clean file: The "Previous revision:"
> prompt's default will be the revision before HEAD.

Is this consistent with the current behavior with files?

I mean, if there are any uncommitted changes in a file, we suggest the 
current revision as the one to diff against.

But with a directory we can't so easily determine whether are 
uncommitted changes, but in all likelihood, most of the time when you're 
working on a new feature, there would be. So statistically speaking, 
shouldn't we default to the "file with changes" behavior, suggesting the 
HEAD revision?

I can see where you're coming from though -- that default isn't very 
useful, one might as well not press C-u.

Maybe we should switch to suggesting the previous revision in the prompt 
even when file has changes?

> * lisp/vc/vc.el (vc-diff-build-argument-list-internal): Move
> file-directory-p check. (bug#73232)

Maybe this should mention reusing the value of backend too, for 
completeness.

Also I wonder if it's okay to have a multi-paragraph description in the 
commit message. CONTRIBUTE seems to suggest one paragraph (if any) 
between the summary and the ChangeLog-style contents, but it doesn't 
suggest moving any parts of the description to the bug tracker. But IDK, 
for those who still read the changelog files (instead of using 
vc-print-root-log) this might be too much for a short change. The 
detailed description is great, though, so thanks.

Eli and others, what do you think?