git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
HGHenrik Grubbström <grubba@roxen.com>
Date
Jun 8, 2010, 15:52 UTC
Message-ID
<Pine.GSO.4.63.1006081731550.22466@shipon.roxen.com>
In-Reply-To
<20100607195013.GA27362@pvv.org>
On Mon, 7 Jun 2010, Finn Arne Gangstad wrote:
Show 27 quoted lines
> On Mon, Jun 07, 2010 at 06:37:56PM +0200, Henrik Grubbström wrote:
>>
>> On Mon, 7 Jun 2010, Finn Arne Gangstad wrote:
>>
>>> I think it would be best if git at this time could decide that the
>>> affected files also become dirty. The ideal commit is one that
>>> both alters the .gitattributes _and_ the affected files at the same
>>> time, and git should make it easy to create that commit.
>>
>> I agree in the case of newly added attributes. In the case of
>> repositories already containing unnormalized files this however leads to
>> problems.
>> eg
>>
>>   Consider the case above, but a while later when the repository has been
>>   fixed at HEAD. If an old version from before the normalization is
>>   checked out, the index will once again become dirty, which means that
>>   git will refuse the user to check out some other version unless the
>>   --force flag is given. Excessive use of --force is not a good thing.
>>   If the user is aware of the problem, and checking out old versions is
>>   a common operation, toggling the suggested option might be a good
>>   solution.
>
> Maybe I misunderstand something, but if you check out an older
> version, the .gitattributes file will change to match the old version.
> The old version should not have the conversion attributes set, and
> should therefore result in a clean checkout?

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).

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.
Teaser:
   $ git init foo
   warning: templates not found /home/grubba/share/git-core/templates
   Initialized empty Git repository in /tmp/grubba/foo/.git/
   $ cd foo
   $ cat >expanded-keywords
   $Id: some id string $
   $ git add expanded-keywords
   $ git commit -m 'Initial commit.'
   [master (root-commit) 755d1f6] Initial commit.
    1 files changed, 1 insertions(+), 0 deletions(-)
    create mode 100644 expanded-keywords
   $ git status
   # On branch master
   nothing to commit (working directory clean)
   $ cat >.gitattributes
   * ident
   $ git status
   # On branch master
   # Changed but not updated:
   #   (use "git add <file>..." to update what will be committed)
   #   (use "git checkout -- <file>..." to discard changes in working directory)
   #
   #       modified:   expanded-keywords
   #
   # Untracked files:
   #   (use "git add <file>..." to include in what will be committed)
   #
   #       .gitattributes
   no changes added to commit (use "git add" and/or "git commit -a")
   $ git config core.normalizationPolicy relaxed
   $ git status
   # On branch master
   # Untracked files:
   #   (use "git add <file>..." to include in what will be committed)
   #
   #       .gitattributes
   nothing added to commit but untracked files present (use "git add" to track)
   $ git config core.normalizationPolicy strict
   $ git status
   # On branch master
   # Changed but not updated:
   #   (use "git add <file>..." to update what will be committed)
   #   (use "git checkout -- <file>..." to discard changes in working directory)
   #
   #       modified:   expanded-keywords
   #
   # Untracked files:
   #   (use "git add <file>..." to include in what will be committed)
   #
   #       .gitattributes
   no changes added to commit (use "git add" and/or "git commit -a")
   $ rm .gitattributes
   $ git status
   # On branch master
   nothing to commit (working directory clean)
Which I believe matches all the behaviours that have been requested.

-- Henrik Grubbström grubba@grubba.org Roxen Internet Software AB grubba@roxen.com

Previous: Finn Arne GangstadNext: Finn Arne Gangstad
Message 16 of 19 in “Patches to avoid reporting conversion changes.”
  1. 0/5 Patches to avoid reporting conversion changes.Henrik Grubbström (Grubba), Jun 1, 2010
  2. 1/5 sha1_file: Add index_blob().Henrik Grubbström (Grubba), Jun 1, 2010
  3. 2/5 strbuf: Add strbuf_add_uint32().Henrik Grubbström (Grubba), Jun 1, 2010
  4. 3/5 cache: Keep track of conversion mode changes.Henrik Grubbström (Grubba), Jun 1, 2010
  5. 4/5 cache: Add index extension "CONV".Henrik Grubbström (Grubba), Jun 1, 2010
  6. 5/5 t/t0021: Test that conversion changes are detected.Henrik Grubbström (Grubba), Jun 1, 2010
  7. Junio C HamanoJun 2, 2010
  8. Henrik GrubbströmJun 3, 2010
  9. Jonathan NiederJun 4, 2010
  10. Henrik GrubbströmJun 4, 2010
  11. Jonathan NiederJun 4, 2010
  12. Henrik GrubbströmJun 6, 2010
  13. Finn Arne GangstadJun 7, 2010
  14. Henrik GrubbströmJun 7, 2010
  15. Finn Arne GangstadJun 7, 2010
  16. Henrik GrubbströmJun 8, 2010
  17. Finn Arne GangstadJun 9, 2010
  18. Henrik GrubbströmJun 9, 2010
  19. Finn Arne GangstadJun 10, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.