From: Angelo Borsotti <angelo.borsotti@gmail.com>
To: git <git@vger.kernel.org>
Subject: config core.autocrlf changes the index
Date: Wed, 17 Oct 2012 20:30:35 +0200 [thread overview]
Message-ID: <CAB9Jk9DPLjRDino0A4LotEXC6BSNAjftEUtPQb2bo1TKXPAd+Q@mail.gmail.com> (raw)
Hello,
git config config core.autocrlf changes the index file, apparently
making obsolete its contents
when a repository is cloned.
Run the following script:
# create a bare repository, empty
rm -rf rel.git
mkdir rel.git
cd rel.git
git init --bare
git config core.autocrlf false
cd -
# populate the bare repository
rm -rf temp
git clone rel.git temp
cd temp
echo aaa>f1
git add f1
git commit -m A
git push origin master
cd -
rm -rf temp
# clone then the bare repository
rm -rf int
mkdir int
git clone rel.git int
cd int
git status
git ls-files -s --debug
# (1)
# change then core.autocrlf in the config
git config core.autocrlf false
git status
git ls-files -s --debug
# (2)
cd -
At (1), git status reports "nothing to commit", but at (2) it reports:
On branch master
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: f1
no changes added to commit (use "git add" and/or "git commit -a")
The two git ls-files -s --debug commands report also differences in the index.
This seems rather strange, although one can think that changing
core.autocrlf might imply that the files in the workspace might have
no longer the same contents that they had should they have benn
checked out with the new core.autocrlf.
Be as it is, at least this unexpected effect of changing core.autocrlf
should be documented.
-Angelo Borsotti
reply other threads:[~2012-10-17 18:30 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAB9Jk9DPLjRDino0A4LotEXC6BSNAjftEUtPQb2bo1TKXPAd+Q@mail.gmail.com \
--to=angelo.borsotti@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).