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#65049: Minor update to the repro steps Date: Mon, 07 Aug 2023 19:24:19 +0300 Message-ID: <83il9qom6k.fsf@gnu.org> References: <83y1iruky1.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16113"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 65049@debbugs.gnu.org To: Maxim Kim Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Aug 07 18:25:21 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 1qT32m-0003y4-HS for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 07 Aug 2023 18:25:20 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qT32W-0001Qe-MQ; Mon, 07 Aug 2023 12:25:04 -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 1qT32V-0001Pw-4p for bug-gnu-emacs@gnu.org; Mon, 07 Aug 2023 12:25: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 1qT32U-0008RM-Rk for bug-gnu-emacs@gnu.org; Mon, 07 Aug 2023 12:25:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qT32U-0002UZ-Ig for bug-gnu-emacs@gnu.org; Mon, 07 Aug 2023 12:25:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 07 Aug 2023 16:25:02 +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.16914254499515 (code B ref 65049); Mon, 07 Aug 2023 16:25:02 +0000 Original-Received: (at 65049) by debbugs.gnu.org; 7 Aug 2023 16:24:09 +0000 Original-Received: from localhost ([127.0.0.1]:34142 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qT31c-0002TP-J8 for submit@debbugs.gnu.org; Mon, 07 Aug 2023 12:24:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38552) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qT31Z-0002Sp-7c for 65049@debbugs.gnu.org; Mon, 07 Aug 2023 12:24:07 -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 1qT31T-0008K6-TZ; Mon, 07 Aug 2023 12:23:59 -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=XPmDSSRC0Ra/L6WZs/AkC4K2ITbDYZXFVWr9yWFJkiI=; b=M1DRwzt8Qu7Y 4MzkKwBdKllKkG9lirvJn36nZr8IwyedLV39A/a2w0YMwybq/rgZrcIfSkkQAbx7vpeDZcczTR5IZ Jzc02HLEAZRIrENMl6MyiCNE1GdugpZGeag7I/9CdQu7SPJFeOk7SPiHKh2R9hgfvIUb01HhZO83K A5vWu6SfJqCmkbt4jrEKR4AE072R8TQJjIXYejcZ9Q2ZH0jqiNI/i8EJObTOa9Nij1NC1DyrknqRm 3hWbNtcNt21ICkfi27rdYESdGHm3hsHNLCwG3GofWuL4WGDH0Z7Yzuo6hCVwgphQhboU0B7B9C8Ws b5giGcmes97UgVk5vu3mkQ==; In-Reply-To: (message from Maxim Kim on Mon, 07 Aug 2023 11:09:09 +1000) 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:266895 Archived-At: > From: Maxim Kim > Date: Mon, 07 Aug 2023 11:09:09 +1000 > > > It looks like line ending issue, I have tried generated patch in a terminal: > > PS C:\Users\maxim.kim\.emacs.d> git --no-pager apply --cached ..\AppData\Local\Temp\git-patchyYAcN5 > error: patch failed: init.el:1 > error: init.el: patch does not apply > > Then added --ignore-space-change (found in > https://www.delftstack.com/howto/git/git-patch-does-not-apply/#troubleshoot-git-patch-error-patch-does-not-apply > and in magit issues https://github.com/magit/magit/issues/1139 plus > linked https://github.com/magit/magit/issues/487#issuecomment-31727377) > > PS C:\Users\maxim.kim\.emacs.d> git --no-pager apply --ignore-space-change --cached ..\AppData\Local\Temp\git-patchyYAcN5 > PS C:\Users\maxim.kim\.emacs.d> > > and git apply worked out. Yes, but where did the file git-patchyYAcN5 come from in the first place? It's that file that is the problem, not how we apply the diffs in that file. If you invoke "git diff SOME-FILE > diffs", from the shell prompt, where SOME-FILE is a file that is modified wrt the repository's state, does the file 'diffs' created by this command have DOS CRLF EOL format, or does it have Unix Newline-only EOL format? Try this with a file that has Unix EOLs in the repository. If Git produces DOS CRLF EOLs when it generates diffs, then that is your problem, and it can only be fixed in Git itself: you need to configure Git to never perform any EOL conversions: $ git config --global core.autocrlf false This is the only sane setting for multiplatform Git repositories, especially if you are using Emacs as your editor, because Emacs always preserves the EOL format of a file you edit, even if the EOL format is not the "native" one on the platform where you edit the file. (In general, when you install Git on Windows, select the "as-is" option of EOL conversions, then you will not need to perform the above "git config" command manually, as this will be set up for you from the get-go.) I'm guessing that I don't see the problem you report because I have disabled EOL conversion in Git years ago.