From: Dmitry Gutov <dmitry@gutov.dev>
To: Spencer Baugh <sbaugh@janestreet.com>
Cc: 62940@debbugs.gnu.org, Filipp Gunbin <fgunbin@fastmail.fm>
Subject: bug#62940: 29.0.60; vc: no easy way to get diff of all outgoing changes
Date: Sat, 14 Sep 2024 05:11:48 +0300 [thread overview]
Message-ID: <02b37700-a48d-4a7c-8e61-b37dfbabc062@gutov.dev> (raw)
In-Reply-To: <ier7cbfp94q.fsf@janestreet.com>
Hi!
On 13/09/2024 23:54, Spencer Baugh wrote:
> This works great, but is a bit tricky to use because you need to type
> the upstream branch ref. I think it would be good to provide that as an
> additional default in the prompt for the old revision. The attached
> patch does that. (and probably is enough to close this bug)C-u M-x vc-root-diff will prompt for the old revision to use for the
> diff. It includes the current working revision as a default.
I like the idea. See comments below.
> Now it also includes the last pushed revision as a default, through a
> new pushed-revision vc backend function.* lisp/vc/vc-git.el (vc-git-pushed-revision): Add.
> (vc-git-log-outgoing): Use vc-git-pushed-revision.
> * lisp/vc/vc-hg.el (vc-hg-pushed-revision): Add.
> * lisp/vc/vc.el (vc-default-pushed-revision): Add new backend function
> with default implementation returning nil.
Am I too used to Git, or should this be called upstream-revision or
origin-revision?
The user might have just recently cloned the repository and not pushed
anything yet. Anyway, matter of taste.
(defun vc-hg-pushed-revision (_file &optional remote-location)
> + "Return a revspec for the last commit not outgoing to REMOTE-LOCATION."
> + (unless remote-location
> + (setq remote-location ""))
> + (format "last(. and not outgoing(%s))" remote-location))
Is the second argument even non-nil in the Hg implementation?
(defun vc-diff-build-argument-list-internal (&optional fileset)
> "Build argument list for calling internal diff functions."
> (let* ((vc-fileset (or fileset (vc-deduce-fileset t))) ;FIXME: why t? --Stef
> @@ -2069,6 +2074,8 @@ vc-diff-build-argument-list-internal
> (first (car files))
> (rev1-default nil)
> ) ;; (rev2-default nil)
> + (when-let ((pushed-revision (vc-call-backend backend 'pushed-revision first)))
> + (push pushed-revision rev1-default))
Maybe we would prefer to keep the current suggestion as the first
default, and have the upstream as the second suggestion (on M-n)? For
backward compatibility anyway. I'm not 100% sure - the upstream ref
seems like a more useful default in a lot of cases (and harder to type
out when you do want it), but it's also workflow-specific.
next prev parent reply other threads:[~2024-09-14 2:11 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-18 19:12 bug#62940: 29.0.60; vc: no easy way to get diff of all outgoing changes Spencer Baugh
2023-04-18 20:36 ` Filipp Gunbin
2023-04-18 20:43 ` Dmitry Gutov
2023-04-19 6:49 ` Juri Linkov
2023-08-14 19:42 ` Spencer Baugh
2023-08-16 7:48 ` Juri Linkov
2024-09-13 20:54 ` Spencer Baugh via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-09-14 2:11 ` Dmitry Gutov [this message]
2024-09-14 7:12 ` Eli Zaretskii
2024-10-10 0:26 ` Dmitry Gutov
2024-10-10 5:27 ` Eli Zaretskii
2024-10-11 1:13 ` Dmitry Gutov
2024-10-11 6:07 ` Eli Zaretskii
2024-10-11 14:40 ` Dmitry Gutov
2024-10-11 1:34 ` Dmitry Gutov
2024-10-11 14:39 ` Dmitry Gutov
2024-10-11 15:10 ` Spencer Baugh via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-11 20:28 ` Dmitry Gutov
2024-10-11 22:38 ` Dmitry Gutov
2024-10-12 8:32 ` Eli Zaretskii
2024-10-15 18:10 ` Spencer Baugh via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-16 20:02 ` Dmitry Gutov
2024-10-16 20:11 ` Spencer Baugh via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-10-16 23:53 ` Dmitry Gutov
2023-04-18 21:59 ` Spencer Baugh
2023-04-21 18:36 ` sbaugh
2023-04-22 6:57 ` Eli Zaretskii
2023-04-22 13:00 ` sbaugh
2023-04-22 13:17 ` Eli Zaretskii
2023-04-22 18:33 ` Dmitry Gutov
2023-04-22 19:27 ` Eli Zaretskii
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=02b37700-a48d-4a7c-8e61-b37dfbabc062@gutov.dev \
--to=dmitry@gutov.dev \
--cc=62940@debbugs.gnu.org \
--cc=fgunbin@fastmail.fm \
--cc=sbaugh@janestreet.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.
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.