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

.gitattributes glob matching broken

From
HKHannu Koivisto <azure@iki.fi>
Date
Nov 2, 2008, 16:33 UTC
Message-ID
<83od0yaxzk.fsf@kalahari.s2.org>
Greetings,

It seems that, for example, glob pattern *.s matches files with .sh extension at least with checkout and reset --hard but git status thinks otherwise:

mkdir test cd test git init echo -e "*.sh -crlf\n*.s crlf" > .gitattributes echo -e "foobar\nfoobar\nfoobar" > kala.s echo -e "foobar\nfoobar\nfoobar" > kala.sh git add .gitattributes kala.s kala.sh git commit -m "Foo." cd .. git clone -n test test2 cd test2 git config core.autocrlf true git checkout 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: kala.sh # no changes added to commit (use "git add" and/or "git commit -a")

file kala.s kala.sh

kala.s: ASCII text, with CRLF line terminators kala.sh: ASCII text, with CRLF line terminators

Tested in Linux with git 1.6.0.3.535.g933bb (master as of this writing) but also witnessed in Windows and with slightly older git versions.

This makes git use in a Windows environment pretty much impossible if you don't want to / can't rely on git guessing "text" vs. "binary" files correctly so I hope a solution is found soon.

It would also be good to document what kind of glob patterns git actually supports. I made the assumption that at least on Linux it supports whatever glob(7) says but even if that assumption is correct (which it may not be, of course) for example Windows users may not realize to look for such a manual page.

-- 
Hannu
Next: Jeff King
Message 1 of 9 in “.gitattributes glob matching broken”
  1. Hannu KoivistoNov 2, 2008
  2. Jeff KingNov 3, 2008
  3. CRLF support bugs (was: Re: .gitattributes glob matching broken)Hannu Koivisto, Nov 3, 2008
  4. Hannu KoivistoNov 3, 2008
  5. Dmitry PotapovNov 3, 2008
  6. Hannu KoivistoNov 3, 2008
  7. Jeff KingNov 4, 2008
  8. Kelly F. HickelNov 4, 2008
  9. Jeff KingNov 5, 2008

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.