From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#73407: 31.0.50; Add diff-discard-hunk Date: Tue, 24 Sep 2024 15:27:16 +0300 Message-ID: <96efe4b3-edf4-4ae1-9c54-fc3dd5abc3f8@yandex.ru> References: <87jzf58g2t.fsf@zephyr.silentflame.com> <98752a7f-d4cd-4397-ad43-0807e29f7803@yandex.ru> <877cb1o5cp.fsf@zephyr.silentflame.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11468"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: 73407@debbugs.gnu.org, juri@linkov.net To: Sean Whitton Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Sep 24 14:27:43 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1st4dr-0002no-1e for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 24 Sep 2024 14:27:43 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1st4dm-00017Q-UT; Tue, 24 Sep 2024 08:27:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1st4dm-00017H-4j for bug-gnu-emacs@gnu.org; Tue, 24 Sep 2024 08:27:38 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1st4dl-0003nt-Q8 for bug-gnu-emacs@gnu.org; Tue, 24 Sep 2024 08:27:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=In-Reply-To:From:References:MIME-Version:Date:To:Subject; bh=EN0F7Of0gJKf9gJyDspVW3tO01hlqZEjk+VAMb6H37E=; b=DCXPy9oNkBU4jg2aJElSsoSYafV5kVy7tYmvpYiXFZJtr/hngoHiJPCjZ1DNgGvNx/EFThW/Zd0p8OHV1hYxd4l8lrLmluIXqJr5vLBYbFWeD767hRYmg5ZoCaxNP/Vg0WxPuXmy+kFD5/W5bZXSl71iYQmWRdsgYiDTmXDbvK02fYLXjsoNx7ZGgFS1bAyGiUo4jMz/J8xNG5fEKDFFF6oasnzSTn3QHVDvZa7/6KOmgYY849ibA3IbraMH7Sv8qrFKrGNlbUTg2VoiF0Au7+oCnqaaFdHTLo0lXtFrI+WOrRNKZucdZBz36pIwkdxbkFcdmKKq3yeC6g5MwL7n4g==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1st4eA-0006Kd-2a for bug-gnu-emacs@gnu.org; Tue, 24 Sep 2024 08:28:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 24 Sep 2024 12:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 73407 X-GNU-PR-Package: emacs Original-Received: via spool by 73407-submit@debbugs.gnu.org id=B73407.172718087224316 (code B ref 73407); Tue, 24 Sep 2024 12:28:02 +0000 Original-Received: (at 73407) by debbugs.gnu.org; 24 Sep 2024 12:27:52 +0000 Original-Received: from localhost ([127.0.0.1]:45513 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1st4dz-0006K8-LN for submit@debbugs.gnu.org; Tue, 24 Sep 2024 08:27:51 -0400 Original-Received: from forward502a.mail.yandex.net ([178.154.239.82]:35570) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1st4dx-0006Jy-JS for 73407@debbugs.gnu.org; Tue, 24 Sep 2024 08:27:50 -0400 Original-Received: from mail-nwsmtp-smtp-production-main-24.iva.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-24.iva.yp-c.yandex.net [IPv6:2a02:6b8:c0c:9a26:0:640:21cf:0]) by forward502a.mail.yandex.net (Yandex) with ESMTPS id 8F1A261B33; Tue, 24 Sep 2024 15:27:23 +0300 (MSK) Original-Received: by mail-nwsmtp-smtp-production-main-24.iva.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id LRSMgraOcuQ0-kJyFbVEp; Tue, 24 Sep 2024 15:27:22 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1727180843; bh=EN0F7Of0gJKf9gJyDspVW3tO01hlqZEjk+VAMb6H37E=; h=In-Reply-To:From:Subject:Message-ID:Cc:References:Date:To; b=tKYR8qGwmbyNp73kqYMqSb2SLp+KqkNWOSP/mdZe78/ylPgfEAmOzaq1/8uPwvOfy 97TI7hKYuQvjFfMdbBpJjcEZDLpoogE2YM8jJgNjQZ6Wywffdse8Cr+ET60anTR8Av swa46oCFJg2Ffs178/BDevfbc55FB3OK8jgrGzYs= Authentication-Results: mail-nwsmtp-smtp-production-main-24.iva.yp-c.yandex.net; dkim=pass header.i=@yandex.ru Original-Received: from phl-compute-09.internal (phl-compute-09.phl.internal [10.202.2.49]) by mailfauth.phl.internal (Postfix) with ESMTP id DE51E120006B; Tue, 24 Sep 2024 08:27:20 -0400 (EDT) Original-Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-09.internal (MEProxy); Tue, 24 Sep 2024 08:27:20 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvddtvddgheduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdej necuhfhrohhmpeffmhhithhrhicuifhuthhovhcuoegughhuthhovheshigrnhguvgigrd hruheqnecuggftrfgrthhtvghrnhepiefhjeeuveetffffvdefteffffekhfeuudejieeh heeiudelgfehgffffeduffdunecuvehluhhsthgvrhfuihiivgepudenucfrrghrrghmpe hmrghilhhfrhhomhepughguhhtohhvodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhi thihqddufeeffeelleehhedvqddvleegjeejjeejiedqughguhhtohhvpeephigrnhguvg igrdhruhesfhgrshhtmhgrihhlrdgtohhmpdhnsggprhgtphhtthhopeefpdhmohguvgep shhmthhpohhuthdprhgtphhtthhopehsphifhhhithhtohhnsehsphifhhhithhtohhnrd hnrghmvgdprhgtphhtthhopeejfeegtdejseguvggssghughhsrdhgnhhurdhorhhgpdhr tghpthhtohepjhhurh X-ME-Proxy: Feedback-ID: ib1d9465d:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 24 Sep 2024 08:27:19 -0400 (EDT) Content-Language: en-US In-Reply-To: <877cb1o5cp.fsf@zephyr.silentflame.com> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:292327 Archived-At: 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.