Subject: Re: [PATCH v4 0/5] Patches to avoid reporting conversion changes.

From: Finn Arne Gangstad <[email-masked]>
Date: Thu, 10 Jun 2010 21:55:55 +0200

On Wed, Jun 09, 2010 at 08:04:34PM +0200, Henrik Grubbström wrote:

> Ok, so the expanded-keywords file in the example should show up as  
> modified in relaxed mode as well, but be cleaned if the modified  
> attributes file is added to the index? Or only after being committed?

Not before being committed, since you would otherwise have to add all
other files before adding .gitattributes, but I am not sure even that
is sufficient reason to claim the files are unmodified (see case 3 below).

I think we agree on the following:

If there is a discrepancy between .gitattributes and the contents in
the repository, the following should be true:

git checkout -f (or git reset --hard)
git status -> ALWAYS report modified files in strict mode
sleep 1
touch *
git status -> NEVER report modified files in relaxed mode

The case I think you are asking about above is the following in
"relaxed" mode:

echo "something that causes a discrepancy" >> .gitattributes
git status -> MODIFIED (1)
git add .gitattributes
git status -> MODIFIED (2)
git commit -m "bad commit"
git status -> ???????  (3)    <<-- Do you want this to be CLEAN?
git reset --hard (or git checkout -f)
sleep 1
touch *
git status -> CLEAN    (4)

1 and 4 should be uncontroversial and 2 I think is necessary because
you should be able to git add in several steps. Whether 3 should be
clean or modified I'm not so sure about, I think that it would make it
more likely to get the repo normalized properly if it was still seen
as modified there.

- Finn Arne