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#62731: 29.0.60; diff-apply-hunk doesn't work for creating new files Date: Wed, 2 Oct 2024 22:48:27 +0300 Message-ID: <92fc2d1f-492d-4d42-914f-b6a4cd712306@gutov.dev> References: <87jzyln9g0.fsf@catern.com> <86ldz70z4i.fsf@gnu.org> <36712130-53f5-4515-a887-d8df3175b271@gutov.dev> <86zfnmz40b.fsf@gnu.org> 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="6048"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: sbaugh@catern.com, 62731@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Oct 02 21:49:18 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 1sw5LZ-0001OO-Ba for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 02 Oct 2024 21:49:18 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sw5LN-0005zj-6g; Wed, 02 Oct 2024 15:49:05 -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 1sw5LK-0005yE-Jl for bug-gnu-emacs@gnu.org; Wed, 02 Oct 2024 15:49:02 -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 1sw5LJ-0003rA-Je for bug-gnu-emacs@gnu.org; Wed, 02 Oct 2024 15:49:01 -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=cNxSQXtROXq2wiZM8AnkPjoiM3haKGpGjnxUUi1fbyU=; b=ixc5F+PfoDJQMxnMk2rwBwQcNxg/19feMGrZWa0ylI4/zlNXRsygYqTiSO0vLAavTp1UAwmDwkak7m+48nP5PqjgK2PDdC/xbPVHeqSu6u91RO5JpjALcEjkuwuTBXjaZu3Bd2UiNtxFiDxIK5uTEMW7CfpTLY46O8GLrWqgLzlBNHhjh9wSO/nCM1pnR80ICT8QsgEfHGqAZvICqWLpSitar71zpCfUBDISAZT+Cs5X221/usmSOuNLGStfeOmG1+S6fqFOC0mQ1DsW5/KyyoPtQd7dep3x3q9+tPAakDjZ5C81iZsqNQwfWQLa51+xhdq9T6O95EI9prqmDFvexQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sw5LK-0004lT-CS for bug-gnu-emacs@gnu.org; Wed, 02 Oct 2024 15:49: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: Wed, 02 Oct 2024 19:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62731 X-GNU-PR-Package: emacs Original-Received: via spool by 62731-submit@debbugs.gnu.org id=B62731.172789852018268 (code B ref 62731); Wed, 02 Oct 2024 19:49:02 +0000 Original-Received: (at 62731) by debbugs.gnu.org; 2 Oct 2024 19:48:40 +0000 Original-Received: from localhost ([127.0.0.1]:59306 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sw5Ky-0004ka-El for submit@debbugs.gnu.org; Wed, 02 Oct 2024 15:48:40 -0400 Original-Received: from fhigh-a4-smtp.messagingengine.com ([103.168.172.155]:48113) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sw5Kw-0004kJ-DD for 62731@debbugs.gnu.org; Wed, 02 Oct 2024 15:48:38 -0400 Original-Received: from phl-compute-07.internal (phl-compute-07.phl.internal [10.202.2.47]) by mailfhigh.phl.internal (Postfix) with ESMTP id 2B95911401E3; Wed, 2 Oct 2024 15:48:32 -0400 (EDT) Original-Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-07.internal (MEProxy); Wed, 02 Oct 2024 15:48:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1727898512; x=1727984912; bh=cNxSQXtROXq2wiZM8AnkPjoiM3haKGpGjnxUUi1fbyU=; b= Uj8SuM/oTHHnmF/m0Wdux3YV0pqWB5U/Yz6B4FOUWC9xolWq7+tlO3317p6Cg8ef 2GErq9QQoh+pQc+XHFBxL+p5AQxIfk3UTATzMdOKrYeiZ6LcauobkNDqlQm4suFY 05oxw1CLh7+srjavmtr5Swzmnsyjqtd1bYa8SFm2uUAO5uLpSnZ96sEHFImr5ZCr Ffz9zmhOT/9/alVh1TRunlobrfGJoiSdrY2Z7RPytpagPk2sGNQSqTf1vqC9JdOS UtXR2nJBWZIjaffuIXd9NL8p30x9+nALZz5iAp2qEveimZ0gPEbxmmr2GvjlSbsI nZ4+2UKWyE1kvr5qYrnIwg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1727898512; x= 1727984912; bh=cNxSQXtROXq2wiZM8AnkPjoiM3haKGpGjnxUUi1fbyU=; b=B km2YB9EfkCwO1soBhPJ4K8y8RtTK+XVYF8TxNJd8/QknZB1iD87OJFV/H0KX73WP WtV9mP7IUzz8NTVGPKa7OKmskQHSHUdxcsI+ksx6ZWrMtzXMGzXmnBtNeCvukd4j 3rEK5KXTJAUBf1gY2UNhVtwwg9nYqduRPCp7tAmE6tidCh4LVIp+0lwsDKePYHJr 1nyHyot8dbwCAbfCifAnnmoxB7Tl8MGeEEi7LMk/IOzzmVbaV6RdE4tfeu7bfSgK xZUgWtW1VzEOX8ol77n1NLNa1Lm40NqdL3Qi2UztiNK0bYIcT9VlJpE8a4TV8O77 89kTJz7Cyah3PT7i19vhQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrvdduledgudefkecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdp uffrtefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivg hnthhsucdlqddutddtmdenucfjughrpefkffggfgfuvfevfhfhjggtgfesthejredttddv jeenucfhrhhomhepffhmihhtrhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrd guvghvqeenucggtffrrghtthgvrhhnpeetudeljeegheetgfehgeejkeeuhedvveeikeeu fedtvddtveefhfdvveegudejheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epmhgrihhlfhhrohhmpegumhhithhrhiesghhuthhovhdruggvvhdpnhgspghrtghpthht ohepfedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepvghlihiisehgnhhurdhorh hgpdhrtghpthhtohepshgsrghughhhsegtrghtvghrnhdrtghomhdprhgtphhtthhopeei vdejfeduseguvggssghughhsrdhgnhhurdhorhhg X-ME-Proxy: Feedback-ID: i07de48aa:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 2 Oct 2024 15:48:30 -0400 (EDT) Content-Language: en-US In-Reply-To: <86zfnmz40b.fsf@gnu.org> 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:292864 Archived-At: On 02/10/2024 22:41, Eli Zaretskii wrote: >> With Hg, the format look like this: >> >> diff -r df0ef194120b -r 2039b18843da accessible/aom/AccessibleNode.cpp >> >> No mention of 'Hg', that is. Could we match "\`diff -r" and > > If Hg doesn't prepend fake leading directories, we don't need to be > bothered by Hg. It does. A fuller example, with deletion: diff -r d045d1125783 -r 9396bae6ff0d CLOBBER.new --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/CLOBBER.new Fri Dec 15 20:37:14 2023 +0200 @@ -0,0 +1,56 @@ >>> Also, what about the opposite case, when NEW is /dev/null? does that >>> work correctly? >> >> Not currently or with the proposed patch. It could be fixed along >> similar lines, but I'm not clear on the ideal behavior here. Delete the >> "old" file and kill its buffer? And say that with 'message'? > > Something like that, yes. We could also delete the file silently. I'm concerned the user is going to wonder whether anything happened at all, and checking is a non-trivial action. But if you think this is fine, I guess it's something to try. >> Deleting files is something that one can do manually, though, so solving >> this seems lower priority. > > When you apply a large set of diffs in which one file is deleted, > there's no easy way of knowing you should deleted that file. In the current version of code you will be asked midway through a file (or right away, when using diff-apply-hunk) to specify a file name, defaulting to /dev/null, and after you press C-g after seeing the odd prompt the hunk won't be applied. So it's hard to miss, at least.