GNU bug report logs - #73407
31.0.50; Add diff-discard-hunk

Previous Next

Package: emacs;

Reported by: Sean Whitton <spwhitton <at> spwhitton.name>

Date: Sat, 21 Sep 2024 10:20:01 UTC

Severity: normal

Found in version 31.0.50

Done: Sean Whitton <spwhitton <at> spwhitton.name>

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: Sean Whitton <spwhitton <at> spwhitton.name>
Cc: 73407 <at> debbugs.gnu.org, juri <at> linkov.net
Subject: bug#73407: 31.0.50; Add diff-discard-hunk
Date: Tue, 24 Sep 2024 15:27:16 +0300
On 24/09/2024 10:53, Sean Whitton wrote:

>> I'd like to clarify one thing first: for 'C-x v v' to work correctly in a diff
>> buffer (such as one produced by 'C-x v D') you don't have to synchronize any
>> changes in that buffer back to disk before making the commit. In fact, we went
>> to some effort to make this a non-requirement.
> 
> Right.  I believe I was responsible for some of that effort!

Oh, right. Sorry.

>> So when you just want to edit the patch before the commit, you can do so
>> already, for example using 'M-k' (diff-hunk-kill) - or just 'k' if the buffer
>> is read-only.
>>
>> But of course if the idea is to really "discard" some changes, that works.
> 
> Yeah, this is about really discarding the changes.
> 
> It's like using C-x v D as a kind of review view.  You use it for
> committing what you want to keep and getting rid of temporary changes
> you made just for development purposes, such as additional debug prints.
> 
> When I used Magit I used its magit-discard for this a lot (the docstring
> for that function talks about conflicts but it's also useful without those).
> 
> One question I have is whether this should offer a y/n prompt to confirm
> discarding the change.  Do you have an opinion on that?

I guess we should? 'diff-hl-revert-hunk' also prompts, but it has a user 
option to disable that.




This bug report was last modified 240 days ago.

Previous Next


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