GNU bug report logs - #62940
29.0.60; vc: no easy way to get diff of all outgoing changes

Previous Next

Package: emacs;

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

Date: Tue, 18 Apr 2023 19:13:02 UTC

Severity: wishlist

Found in version 29.0.60

Full log


Message #64 received at 62940 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dmitry <at> gutov.dev>
To: Spencer Baugh <sbaugh <at> janestreet.com>
Cc: 62940 <at> debbugs.gnu.org, Filipp Gunbin <fgunbin <at> fastmail.fm>
Subject: Re: bug#62940: 29.0.60; vc: no easy way to get diff of all outgoing
 changes
Date: Fri, 11 Oct 2024 04:34:32 +0300
BTW:

On 13/09/2024 23:54, Spencer Baugh wrote:
> +(defun vc-git-pushed-revision (_file &optional remote-location)
> +  "Return the ref for REMOTE-LOCATION."
> +  (if (and remote-location (not (string-empty-p remote-location)))
> +      remote-location
> +    "@{upstream}"))

The function above and the function below

+(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))

...seem to be describing different kinds of refs: I think the Hg version 
refers to the last commit from the current branch that's present in the 
remote (the merge base), whereas the Git version points to the tip of 
the remote branch.

Which will be different if the remote has some newer changes added 
(perhaps someone else has pushed to it). vc-git-log-outgoing won't 
notice the difference because it uses the ".." range, but vc-git-diff 
compares two versions directly, so e.g. anything new added to the remote 
will be shown as removed in such diff.

We probably want "merge base with remote" for Git as well (git 
merge-base @{upstream} HEAD), but it doesn't have a similar short ref 
syntax.

Could use "merge-base(@{upstream})" or "@{upstream}.." as a special 
value, maybe.




This bug report was last modified 24 days ago.

Previous Next


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