GNU bug report logs - #52349
29.0.50; vc-git and diff-mode: stage hunks

Previous Next

Package: emacs;

Reported by: Manuel Uberti <manuel.uberti <at> inventati.org>

Date: Tue, 7 Dec 2021 09:00:02 UTC

Severity: normal

Fixed in version 29.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Juri Linkov <juri <at> linkov.net>
Cc: 52349 <at> debbugs.gnu.org
Subject: bug#52349: 29.0.50; vc-git and diff-mode: stage hunks
Date: Mon, 29 Aug 2022 02:34:46 +0300
On 28.08.2022 22:45, Juri Linkov wrote:
> close 52349 29.0.50
> thanks
> 
>>> The problem is that currently using 'C-c C-d' (log-edit-show-diff)
>>> in the *vc-log* buffer doesn't show the same diff that will be really
>>> committed when different files were marked in *vc-dir* parent buffer
>>> before typing 'C-c C-c' in *vc-log*.
>>> This is because currently log-edit-diff-function is set to vc-diff
>>> that is not suitable here since it tries to deduce fileset again
>>> from *vc-dir*, but files to commit are set in the buffer-local
>>> 'vc-log-fileset' in *vc-log*.  So I added a new function
>>> 'log-edit-diff-fileset' that shows the diff from 'vc-log-fileset'.
>>> Using the same naming scheme, I renamed 'vc-diff-patch' to
>>> 'log-edit-diff-patch'.
>>> This shows the difference from the previous patch,
>>> but later these changes could be committed separately:
>>
>> Makes perfect sense, thanks.
> 
> So now pushed and closed.  If more changes are needed,
> this could be reopened or a new bug report opened.

Seems to be working well. Thank you!

>> Honestly, I think it's a long-requested advanced feature which we'd be
>> happy to have even if there were rough edges remaining (as long as it
>> doesn't corrupt users' files or otherwise loses changes, of course). But
>> this seems to be coming along nicely.
> 
> 'vc-finish-logentry' has such FIXME:
> 
>    (let ((logbuf (current-buffer))
> 	(log-operation vc-log-operation)
>          ;; FIXME: When coming from VC-Dir, we should check that the
>          ;; set of selected files is still equal to vc-log-fileset,
>          ;; to avoid surprises.
> 	(log-fileset vc-log-fileset)
>      (pop-to-buffer vc-parent-buffer)
> 
> I tried to fix this, but it requires duplicating too much code
> from vc-next-action, including code that prepares 'ready-for-commit'
> list of files.  I'm afraid that such check often will raise
> a false alarm.
> 
> OTOH, maybe this check is not needed since I fixed 'C-c C-d' above
> to show the same diff that will be committed using vc-log-fileset,
> and 'C-c C-c' uses the same vc-log-fileset as well.

Hopefully, yes.




This bug report was last modified 2 years and 194 days ago.

Previous Next


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