From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS53758 23.128.96.0/24 X-Spam-Status: No, score=-4.1 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 37CCB1F8C6 for ; Sun, 25 Jul 2021 15:04:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231292AbhGYOXl (ORCPT ); Sun, 25 Jul 2021 10:23:41 -0400 Received: from smtprelay02.ispgateway.de ([80.67.18.14]:63235 "EHLO smtprelay02.ispgateway.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231208AbhGYOXl (ORCPT ); Sun, 25 Jul 2021 10:23:41 -0400 Received: from [87.152.157.21] (helo=[192.168.2.202]) by smtprelay02.ispgateway.de with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1m7feN-0002VV-0a for git@vger.kernel.org; Sun, 25 Jul 2021 17:02:43 +0200 From: Martin To: git@vger.kernel.org Subject: Files modified, even after: git reset --hard Message-ID: Date: Sun, 25 Jul 2021 17:04:08 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB X-Df-Sender: bWVAbWZyaWViZS5kZQ== Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org I have some files, that will show up modified. Always. If I just switch to a commit, with clean worktree before, then those files will be modified. I can not stash them. git reset --hard does not change anything. Diff shows the entire file is modified. I suspect its the line endings.. This happens on windows, and   autocrlf=true The checked out file (which is marked as modified) has the correct CrLf endings. What I have not been able to find, is what line endings are stored in the blob. Its an xml file, so they should be just Lf. But I *suspect* that the blob contains either CrLf, or mixed line-endings. Could that be? that if a file does have unexpected line endings in the commit's blob, that it shows as modified? One the one hand, yes, If I commit, that file will change. On the other hand, if I just check out (or do reset-hard) then I don't expect modified files.... So what should happen? This also causes problems, because in order to for example rebase something, I first need to switch to some commit that can be checked out without modified files. Or rebase will not work. Also in that repro, I had problems that some rebases failed with (with and without --reapply-cherry-picks)    error: add_cacheinfo failed Those rebase where between an orphaned branch, and a "normal" branch. And it is possible that the file only had the line ending issues in one of the 2 branches.... But that I was not able to further investigate. //git for windows git version 2.32.0.windows.2