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


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

From: Juri Linkov <juri <at> linkov.net>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 52349 <at> debbugs.gnu.org
Subject: Re: bug#52349: 29.0.50; vc-git and diff-mode: stage hunks
Date: Thu, 08 Sep 2022 22:29:29 +0300
>>>>> Perhaps we should also check that there are no existing staged changes for
>>>>> those files, and if so, abort? This way we won't commit anything else by
>>>>> accident.
>>>> Will do later.
>>> Shouldn't be too hard, if we don't try to do it eagerly. Just add a check
>>> inside (when vc-git-patch-string ...) in vc-git-checkin.
>> +      (unless (eq (vc-git-command nil t nil "diff" "--cached" "--quiet") 0)
>> +        (error "Index not empty"))
>
> user-error, maybe?

Oh, it has a sad shortcoming: this feature can't be used when a new file
is added with 'C-x v v' since new files get added directly to the index,
and checking for the empty index raises the error for the whole changeset
with modified old files and new files.




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.