From: Finn Arne Gangstad <finnag@pvv.org>
To: "Henrik Grubbström" <grubba@roxen.com>
Cc: Jonathan Nieder <jrnieder@gmail.com>,
Junio C Hamano <gitster@pobox.com>,
git@vger.kernel.org
Subject: Re: [PATCH v4 0/5] Patches to avoid reporting conversion changes.
Date: Wed, 9 Jun 2010 16:03:28 +0200 [thread overview]
Message-ID: <20100609140327.GA19828@pvv.org> (raw)
In-Reply-To: <Pine.GSO.4.63.1006081731550.22466@shipon.roxen.com>
On Tue, Jun 08, 2010 at 05:52:37PM +0200, Henrik Grubbström wrote:
> [...]
> True, there's no problem before the attribute change, but there is for
> commits between the attribute change and when the repository got
> normalized (which can be a while with the current git).
As you say, the current git makes it easy to commit something where
the attributes and the contents do not match. I think this needs to be
fixed, and that your proposed patch in relaxed mode makes the problem
_worse_, since it will then take even longer before these commits are
fixed. But see below.
>
> Re: configuration option naming:
>
> I've settled for core.normalizationPolicy, with the values
> 'strict' (default) for the behaviour requested by you and Jonathan,
> and 'relaxed' for my initial behaviour.
The name might be a bit vague, maybe there are other things that could
be normalized? Maybe adding the word "index" is an improvement -
e.g. core.indexNormalizationPolicy or just core.indexNormalization.
>
> Teaser:
> [...]
> $ git status
> # On branch master
> nothing to commit (working directory clean)
> $ cat >.gitattributes
> * ident
> $ git status
> [...]
> # modified: expanded-keywords
> [...]
>
> $ git config core.normalizationPolicy relaxed
> $ git status
> # On branch master
> [No longer modified]
THIS behaviour is what I find scary. In this case, "ident" is clearly
a newly added attribute, and git should not hide this from you. If you
add a mode where git will hide this permanently, chances are the
repositories will never be fixed.
The ident attribute may be a bit special since in your case it is only
supposed to change if some other contents in the file change as well,
but please also think how this will work with the text/eol
attributes. Setting the text attribute and then having to CHANGE a
file before getting it normalized is not good.
Still, I think your original problem description of cloning something
and ending up with a dirty tree is indeed an annoying problem. So
what about having the relaxed mode behave as follows:
If both of these are true:
- the current attributes for a file are the same as it is registered as
in the index with your new patch
- a checkout of the file would result in identical contents to what is
currently in the working directory
Then behave as if the file is not modified.
Or, in other words: If attributes are unchanged, a file is unmodified
not only if it would result in the same contents after being added,
but also if it would result in the current working directory
contents after being checked out again.
This should work for both text and ident on clone at least.
- Finn Arne
next prev parent reply other threads:[~2010-06-09 14:03 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-01 14:41 [PATCH v4 0/5] Patches to avoid reporting conversion changes Henrik Grubbström (Grubba)
2010-06-01 14:41 ` [PATCH v4 1/5] sha1_file: Add index_blob() Henrik Grubbström (Grubba)
2010-06-01 14:41 ` [PATCH v4 2/5] strbuf: Add strbuf_add_uint32() Henrik Grubbström (Grubba)
2010-06-01 14:41 ` [PATCH v4 3/5] cache: Keep track of conversion mode changes Henrik Grubbström (Grubba)
2010-06-01 14:41 ` [PATCH v4 4/5] cache: Add index extension "CONV" Henrik Grubbström (Grubba)
2010-06-01 14:41 ` [PATCH v4 5/5] t/t0021: Test that conversion changes are detected Henrik Grubbström (Grubba)
2010-06-02 4:40 ` [PATCH v4 0/5] Patches to avoid reporting conversion changes Junio C Hamano
2010-06-03 16:00 ` Henrik Grubbström
2010-06-04 0:56 ` Jonathan Nieder
2010-06-04 11:59 ` Henrik Grubbström
2010-06-04 19:42 ` Jonathan Nieder
2010-06-06 10:50 ` Henrik Grubbström
2010-06-07 8:59 ` Finn Arne Gangstad
2010-06-07 16:37 ` Henrik Grubbström
2010-06-07 19:50 ` Finn Arne Gangstad
2010-06-08 15:52 ` Henrik Grubbström
2010-06-09 14:03 ` Finn Arne Gangstad [this message]
2010-06-09 18:04 ` Henrik Grubbström
2010-06-10 19:55 ` Finn Arne Gangstad
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=20100609140327.GA19828@pvv.org \
--to=finnag@pvv.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=grubba@roxen.com \
--cc=jrnieder@gmail.com \
/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).