From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#62731: 29.0.60; diff-apply-hunk doesn't work for creating new files Date: Wed, 02 Oct 2024 22:41:40 +0300 Message-ID: <86zfnmz40b.fsf@gnu.org> References: <87jzyln9g0.fsf@catern.com> <86ldz70z4i.fsf@gnu.org> <36712130-53f5-4515-a887-d8df3175b271@gutov.dev> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17841"; mail-complaints-to="usenet@ciao.gmane.io" Cc: sbaugh@catern.com, 62731@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Oct 02 21:42:14 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 1sw5Ei-0004Ru-D6 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 02 Oct 2024 21:42:12 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sw5Ec-0005E6-DH; Wed, 02 Oct 2024 15:42:06 -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 1sw5EZ-0005DY-Pb for bug-gnu-emacs@gnu.org; Wed, 02 Oct 2024 15:42:03 -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 1sw5EZ-0002qN-Gy for bug-gnu-emacs@gnu.org; Wed, 02 Oct 2024 15:42:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=NVTEMnWn8YWvEgG/DFNrHKOZ8/DxiyebzPV5cSvE/98=; b=ABh3/a5f08GtrDkRR5ukfai8lQdbIbIBx9xs7vXPH8INboJ841utOY+xhxEFktwG//yjK6Ry0K2YLDQZXx9dTb1wE2qgh4mB0ONpHuwKehk8dvilzDjZKX88lWsgWLIx7FCxqrRRr+KpaCLLXKcAO4MD0H/IgWDkLVsLjTXd7QlMXlv42YWnutxeRDI3CkijfFmgIe1iz3NjVCOJZ5xR7AAaU8gwyTJWG4VTQB/madT0qVqwxxFpAIdcRZQO5kB52Dqpdee8AaibSrKQYBH8j9F3QE8j0a56Ym2BEXKll1eAzf7YC2ujK07C0XkULQUkxfk9MqF2SDZoG/EFR4FScg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sw5EZ-0004Ph-AD for bug-gnu-emacs@gnu.org; Wed, 02 Oct 2024 15:42:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 02 Oct 2024 19:42:03 +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.172789811316931 (code B ref 62731); Wed, 02 Oct 2024 19:42:03 +0000 Original-Received: (at 62731) by debbugs.gnu.org; 2 Oct 2024 19:41:53 +0000 Original-Received: from localhost ([127.0.0.1]:59294 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sw5EP-0004P0-70 for submit@debbugs.gnu.org; Wed, 02 Oct 2024 15:41:53 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:34832) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sw5EN-0004Og-Bn for 62731@debbugs.gnu.org; Wed, 02 Oct 2024 15:41:52 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sw5EG-0002oO-OI; Wed, 02 Oct 2024 15:41:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=NVTEMnWn8YWvEgG/DFNrHKOZ8/DxiyebzPV5cSvE/98=; b=XNYxCRcx7jdc CnMTrS5rwUY683f6Br4iJ7FhbBCM06zGQa41T0WK0zd8u63bGzJOeWLUkflMlDwrFSlH9qoxjOQEG 1Wd47n2Xlrk5JqTGsBpSAMix4842rsYJiyF5eQn5T8d2Tqbt4foQ1osKGmqeshyota7EaoIUkul1r afcyL8DDV+7dA523xWu47NSLVwPii8U6zruqIBkPeH7RtTdIl9EDIkxpCkNPVG3y6vf5Vh0p+C/i2 ChOmMsEr3VdcjmLIB2rMP3cna1YC9wXjMLZX6HiQddX0M273mN4tRvft9m7h9Y4D8gmzM1GTM6g50 d98+25I2eHOzTvtSLiAv2g==; In-Reply-To: <36712130-53f5-4515-a887-d8df3175b271@gutov.dev> (message from Dmitry Gutov on Wed, 2 Oct 2024 21:57:48 +0300) 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:292863 Archived-At: > Date: Wed, 2 Oct 2024 21:57:48 +0300 > Cc: sbaugh@catern.com, 62731@debbugs.gnu.org > From: Dmitry Gutov > > > And relying on b/ being an existing directory can cause > > false positives. How about relying on the "--git" part in the > > "diff --git" header instead, and in the Git case _always_ removing one > > leading directory? > > I guess that's an option too. > > > (And if this also happens with Hg, include that in > > the test as well.) > > 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. > > 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. > 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.