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#65049: Minor update to the repro steps Date: Mon, 28 Aug 2023 01:32:57 +0300 Message-ID: <02a7f7fe-74c2-a59a-7d7d-1da9d3270c8a@gutov.dev> References: <83y1iruky1.fsf@gnu.org> <83il9qom6k.fsf@gnu.org> <86v8dandhq.fsf@mail.linkov.net> <83bkf1woy3.fsf@gnu.org> <835y57tf23.fsf@gnu.org> <87edjvp6ev.fsf@gmail.com> <83350btdw8.fsf@gnu.org> <831qftspal.fsf@gnu.org> <35b50832-e9ca-9f57-fad6-68621d9b42e7@gutov.dev> <83pm3dqbtp.fsf@gnu.org> <789dacd3-8e62-74ad-f691-5b48cb1d678b@gutov.dev> <2f6986e7-f96b-98bd-4581-7503bb01b111@gutov.dev> <83ttsnoda5.fsf@gnu.org> <49d5e741-f97d-ae4d-f79c-ec418051d868@gutov.dev> <83v8d2kx1g.fsf@gnu.org> <8be534f8-9f03-5de6-53c8-76be0f9456fa@gutov.dev> <831qfpkpx7.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="29326"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Cc: 65049@debbugs.gnu.org, habamax@gmail.com, juri@linkov.net To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Aug 28 00:34:18 2023 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 1qaOKm-0007LI-1l for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 28 Aug 2023 00:34:17 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qaOKU-0003h3-3p; Sun, 27 Aug 2023 18:33:58 -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 1qaOKS-0003gu-I7 for bug-gnu-emacs@gnu.org; Sun, 27 Aug 2023 18:33:56 -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 1qaOKS-0003Uq-AA for bug-gnu-emacs@gnu.org; Sun, 27 Aug 2023 18:33:56 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qaOKX-0001dQ-Td for bug-gnu-emacs@gnu.org; Sun, 27 Aug 2023 18:34:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 27 Aug 2023 22:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65049 X-GNU-PR-Package: emacs Original-Received: via spool by 65049-submit@debbugs.gnu.org id=B65049.16931755986223 (code B ref 65049); Sun, 27 Aug 2023 22:34:01 +0000 Original-Received: (at 65049) by debbugs.gnu.org; 27 Aug 2023 22:33:18 +0000 Original-Received: from localhost ([127.0.0.1]:46403 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qaOJp-0001cJ-GO for submit@debbugs.gnu.org; Sun, 27 Aug 2023 18:33:17 -0400 Original-Received: from out1-smtp.messagingengine.com ([66.111.4.25]:45015) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qaOJl-0001c1-6d for 65049@debbugs.gnu.org; Sun, 27 Aug 2023 18:33:16 -0400 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 0CD475C009E; Sun, 27 Aug 2023 18:33:02 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Sun, 27 Aug 2023 18:33:02 -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:sender:subject:subject:to:to; s=fm3; t= 1693175582; x=1693261982; bh=CsvRYBzAprPRWS2+W4LTlAVURQzV3iHEX+Y J+cDbkUA=; b=I8vUL0d1n0pOJWRbm4dZlytaC12VGR4Y1vLEVImr4ylPxqGjzv7 AKq7TzQ90L7Uf+GaqCDhuGpuL6BswZxKO7/VF+xLPukg679hJUUpRQrtuH+kmMiL 1gjQPM0FYnnXwfpxbABxrrjZpyBTlsQysGbVXHLyXDXgLNWJKZ/5wSku1UZtqtHs Q6QWxiBpqMx5xxuuYgPfhDdkLzpzMImaBaoNqfZcewROTHa6r8HFIO9YEQaGVJpT EybS8c5hJgggh9JklDtECnzYch9FKa5KON6N0heM4k+Chno5bxY8hlbsuZqfJ4GC lnpPBTEg+d+7KOR/2b1x+OEoN8WGXLefGBA== 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:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1693175582; x=1693261982; bh=CsvRYBzAprPRWS2+W4LTlAVURQzV3iHEX+Y J+cDbkUA=; b=JwQnNLyi3uZFiDQ8gidEbEvk8wfQL3mHRPiGqAb/RWmC9FalLXH 0r0/EnHeebwuqacV/MFYlrgGNGa/67rJJ8kwORCJDhFfyxX4tBitTrqy3h1Fwa0e ufGu+QC7YcjXEEq0mlOyCx9956ETS9bBLEg6cd1UIAuzb1MYJH3vfnxQ3zuzSKlo dCplsin6IAdWRiOtOPH2A/YDOhuMCeEUCkIXcdS+WZKwLWqhwbe+WtK1/qwiolgC M79EPWMBVckAUDg8f6CT/k+SdSWRYC/D+IwqIQvIMZXGA3Wdtz5FuSjIJ9v7zc9Q 2p4O0hOic+BsyahXpWIWlI61ifzvPgrbKvA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudeffedgudduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtfeejnecuhfhrohhmpeffmhhi thhrhicuifhuthhovhcuoegumhhithhrhiesghhuthhovhdruggvvheqnecuggftrfgrth htvghrnhepiefgteevheevveffheeltdeukeeiieekueefgedugfefgefhudelgfefveel vdevnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepug hmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 27 Aug 2023 18:33:00 -0400 (EDT) Content-Language: en-US In-Reply-To: <831qfpkpx7.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:268594 Archived-At: On 27/08/2023 08:36, Eli Zaretskii wrote: >> Date: Sun, 27 Aug 2023 04:14:11 +0300 >> Cc: juri@linkov.net, habamax@gmail.com, 65049@debbugs.gnu.org >> From: Dmitry Gutov >> >> On 26/08/2023 11:50, Eli Zaretskii wrote: >> >> I'm guessing that if we try hard enough with files encoded in an "alien" >> coding system, we will see a similar difference between vc-diff and >> vc-root-diff. > > We could. The 'undecided-unix' value is a good default, but if the > fileset includes files with different incompatible encodings, there's > no single coding-system that could satisfy that, and what Emacs > guesses will probably be okay for the first file, but not necessarily > for the rest. And it only guesses when passed a file or list of them (e.g. from a selection in vc-dir). >>> . The line you suggest to remove should IMO stay, because your >>> suggestion is based on what you see with plain-ASCII files. If >>> the files have some non-trivial text encoding, failing to use the >>> right encoding for the diffs will produce mojibake. The EOL >>> conversion produced by vc-coding-system-for-diff is indeed >>> problematic, see above; but the text-conversion part is not, and >>> should stay. >>> >>> Therefore, I propose the patch below, which incorporates the above >>> change, for the emacs-29 branch. I think it is safe to use the 'unix >>> EOL conversion on all systems, in the vc-git.el part of the changeset, >>> but if you feel uneasy about that on the release branch, we could make >>> it Windows-specific on emacs-29 and remove the condition on master. >> >> LGTM for emacs-29, thank you. In case anybody reports a problem, we can >> add that OS limitation later. > > Thanks, installed on the emacs-29 branch. Thanks for the fix. >> Regarding your paragraph above about mojibake, though. That makes a lot >> of sense, but I feel I have to stress: this mechanism doesn't work for >> vc-root-diff (C-x v D). > > Not sure I understand. Can you show a recipe for "doesn't work"? It's the same recipe as what you proposed I test (a file with dos line ending on unix). But you don't even have to test that. Try edebug-instrumenting vc-diff-internal and then calling vc-root-diff anywhere (C-x v D). When the execution reaches the line that we have been discussing, you'll see that (vc-coding-system-for-diff (car files)) evaluates to 'undecided because (car files) is a directory. So this mechanism is always unused in vc-root-diff.