From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#55578: 29.0.50; auto-revert-use-notify vs 'git checkout -- ' Date: Tue, 24 May 2022 14:02:35 +0200 Message-ID: <87mtf7nnok.fsf@gmx.de> References: <87r14lfpui.fsf@miha-pc> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16927"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: miha@kamnitnik.top To: 55578@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue May 24 14:28:48 2022 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 1ntTeZ-0004Bh-SJ for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 24 May 2022 14:28:48 +0200 Original-Received: from localhost ([::1]:36516 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ntTeX-0005rt-IU for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 24 May 2022 08:28:45 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45918) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntTLS-0001N6-B5 for bug-gnu-emacs@gnu.org; Tue, 24 May 2022 08:09:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57278) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ntTLS-0006UN-0l for bug-gnu-emacs@gnu.org; Tue, 24 May 2022 08:09:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ntTLR-0001cd-SJ for bug-gnu-emacs@gnu.org; Tue, 24 May 2022 08:09:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 24 May 2022 12:09:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55578 X-GNU-PR-Package: emacs X-Debbugs-Original-To: miha--- via "Bug reports for GNU Emacs, the Swiss army knife of text editors" X-Debbugs-Original-Cc: 55578@debbugs.gnu.org, miha@kamnitnik.top Original-Received: via spool by submit@debbugs.gnu.org id=B.16533940966175 (code B ref -1); Tue, 24 May 2022 12:09:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 24 May 2022 12:08:16 +0000 Original-Received: from localhost ([127.0.0.1]:51175 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ntTKi-0001bX-4I for submit@debbugs.gnu.org; Tue, 24 May 2022 08:08:16 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:48766) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ntTKf-0001bN-KG for submit@debbugs.gnu.org; Tue, 24 May 2022 08:08:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45818) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntTKe-0008PS-W0 for bug-gnu-emacs@gnu.org; Tue, 24 May 2022 08:08:13 -0400 Original-Received: from mout.gmx.net ([212.227.15.18]:56379) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ntTKc-0006PL-Se for bug-gnu-emacs@gnu.org; Tue, 24 May 2022 08:08:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1653394087; bh=jI5J6TwBH6cdyWi/zm01Ri+ealbKdcXk1roH88kZzv4=; h=X-UI-Sender-Class:From:To:Cc:Subject:References:Date:In-Reply-To; b=LeKFoxrw6hEwe+iRTm+t9Qt2saxuRbGvsUbp7w6RJzqZoB6/JL+SXID+lK7XabK4H b+GiyzbK7Iw13JA6jv6ekQD3VZD6pcQFzX95WT42OOyqBEv3szW0PC/MR9rTZb+rtQ cBdzXLmYEsGaDBLg3uK+9Yd9WTeI05WsU1WxdUvE= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Original-Received: from gandalf.gmx.de ([213.220.149.14]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MrhUE-1nWI6z1N9o-00nklA; Tue, 24 May 2022 14:02:37 +0200 In-Reply-To: <87r14lfpui.fsf@miha-pc> (miha's message of "Sun, 22 May 2022 19:18:29 +0200") X-Provags-ID: V03:K1:ILktmV5+ke7tvLngIIhwiVqFp0zhr+T44XG3ydp+EOcmZ/n4hDe w/+tcjDbbe5fc4dnS7vDV9I7ciMEX3GQyefjVfUvDMA8TMVW5rRLKdgbRPzdvbh5anE+q7w Q0F2KD4yLNfArUz/0NraKQfERpYYClBc4UqQfVOnePxHvoRJ1qis/DbfFVyBwi2biNPn7UI +/LAC/Z90akoDIavmi5yw== X-UI-Out-Filterresults: notjunk:1;V03:K0:eKqykdhG1ak=:69YsfdbvmXPbOyekGpXZsA PjnjzhyUnxNQ77FWlMN3wm1E9ylVdUOhEun5Pze0tSwTAslBExjX3BrFwAEYY8CcJvLvAGHZU lyW3HGL2TJ+/aDvjWkmKwNZNdj5GMGsaI1yQaniFVJY3d3vTCjzDu+b7ksAiegAxcfEC2EN+/ ZazybUCS79C84KdgppGSO9tAxuyVqIIsW/1DophTXqlvtgTpzVtUQeSNqXhFMbBpqLp2BKFX6 m41g49gGV1bjGrlgEczZSwtuaDLJqKFxAY2H9KGjgcCy8H/fxqeE1zA0TnGCaMQhHmchFDDzE zefwYEY2XTwpjWrxtMSVEGtGTnMCit3eM5XYfapaYI915JeJMLA5E4glKCrGaBO7HxeIuUKEt cRP+DG8H9oMJ4hiPhN22IW0qCAGMd+7SHrKMplvR97uIw9hvpYdX8PhpvwmB+kyW9gn5VmFyp pYzDEsD65hWjJ48z3gP7qqdq4HEnVZPXUoMNPI4EUDbuzgBKBCLl54+zfIXfWjTyVpI4+niPZ Lkky0VkGYGdWFwAfJUqIzTk5SJUtoLt25B5EP5TEKOLMpJ9RFE9dxDtuMxwBCm2RzGBsisfeG io2fqhhOiEqMAqld4yDh0untzVszAx+a+nMRAsE5b/IvC94nmrXqU1Gom7mc5fSRdTUcXL6W5 ztdi90uD1+f+o8QhNbgg52D54oZkKD+RGt9U8XkryGYfHYvA/alxAruFe54ipGB4GbZXYDOwD Cb8i/ugX2eIDzQ/oQ536Fh6sr/Fq1Z0sBemTPginY0lmxaDlNiefa+T4ogbmrnWYtF/Kx6fH Received-SPF: pass client-ip=212.227.15.18; envelope-from=michael.albinus@gmx.de; helo=mout.gmx.net X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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" Xref: news.gmane.io gmane.emacs.bugs:232997 Archived-At: miha--- via "Bug reports for GNU Emacs, the Swiss army knife of text editors" writes: Hi, > Visit a file in a clean git repository, modify it and save its buffer. > Turn on auto-revert-mode in its buffer. > > Run 'git checkout -- ' and notice that auto-revert-mode > doesn't revert the buffer immediately using 'notify', it only reverts it > according to auto-revert-interval. > > This is in contrast to modifying the file with a command like > 'echo test >> ', after which auto-revert-mode reverts the > buffer instantly using 'notify'. > > This seems to be because prior to writing the file, 'git checkout' > unlinks it first. It would be nice if auto-revert-mode worked with > notify in such cases as well. Indeed, git deletes and (re-)creates the file. See the following file notify events, when monitoring the git repository (/tmp/xxx is the repo, /tmp/xxx/foo the file). This happens, after calling "git checkout -- foo": --8<---------------cut here---------------start------------->8--- file-notify-handle-event (file-notify ((1 . 0) (delete) "foo" 0) file-notify--callback-inotify) file-notify-handle-event (file-notify ((1 . 0) (create) "foo" 0) file-notify--callback-inotify) file-notify-handle-event (file-notify ((1 . 0) (modify) "foo" 0) file-notify--callback-inotify) --8<---------------cut here---------------end--------------->8--- The corresponding events for the file /tmp/xxx/foo are --8<---------------cut here---------------start------------->8--- file-notify-handle-event (file-notify ((1 . 1) (delete) "foo" 0) file-notify--callback-inotify) file-notify-callback (1 . 1) deleted "/tmp/xxx/foo" nil #s(file-notify--watch "/tmp/xxx" "foo" auto-revert-notify-handler) "/tmp/xxx/foo" "/tmp/xxx" auto-revert-notify-handler ((1 . 1) deleted "/tmp/xxx/foo") file-notify-handle-event (file-notify ((1 . 1) stopped "/tmp/xxx/foo") auto-revert-notify-handler) auto-revert-notify-handler ((1 . 1) stopped "/tmp/xxx/foo") --8<---------------cut here---------------end--------------->8--- As you can see, file notifications are stopped after receiving the 'delete' event. This is a feature of our file notifications implementation. Running "echo test >> foo" instead shows the events --8<---------------cut here---------------start------------->8--- file-notify-handle-event (file-notify ((1 . 0) (modify) "foo" 0) file-notify--callback-inotify) file-notify-callback (1 . 0) changed "/tmp/xxx/foo" nil #s(file-notify--watch "/tmp/xxx" nil auto-revert-notify-handler) "/tmp/xxx" "/tmp/xxx" auto-revert-notify-handler ((1 . 0) changed "/tmp/xxx/foo") --8<---------------cut here---------------end--------------->8--- This works as expected. So I fear there's nothing we can do. Best regards, Michael.