GNU bug report logs - #73232
[PATCH] Allow vc-diff to suggest a default revision in vc-dir

Previous Next

Package: emacs;

Reported by: Spencer Baugh <sbaugh <at> janestreet.com>

Date: Fri, 13 Sep 2024 15:53:01 UTC

Severity: normal

Tags: patch

Done: Dmitry Gutov <dmitry <at> gutov.dev>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Spencer Baugh <sbaugh <at> janestreet.com>, Eli Zaretskii <eliz <at> gnu.org>
Cc: 73232 <at> debbugs.gnu.org, juri <at> linkov.net
Subject: bug#73232: [PATCH] Allow vc-diff to suggest a default revision in vc-dir
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?




This bug report was last modified 223 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.