Git development
 help / color / mirror / Atom feed
From: Hannu Koivisto <azure@iki.fi>
To: git@vger.kernel.org
Subject: .gitattributes glob matching broken
Date: Sun, 02 Nov 2008 18:33:51 +0200	[thread overview]
Message-ID: <83od0yaxzk.fsf@kalahari.s2.org> (raw)

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

             reply	other threads:[~2008-11-02 16:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-02 16:33 Hannu Koivisto [this message]
2008-11-03  9:09 ` .gitattributes glob matching broken Jeff King
2008-11-03 15:05   ` CRLF support bugs (was: Re: .gitattributes glob matching broken) Hannu Koivisto
2008-11-03 15:25     ` CRLF support bugs Hannu Koivisto
2008-11-03 16:46     ` CRLF support bugs (was: Re: .gitattributes glob matching broken) Dmitry Potapov
2008-11-03 22:24       ` CRLF support bugs Hannu Koivisto
2008-11-04  5:14     ` CRLF support bugs (was: Re: .gitattributes glob matching broken) Jeff King
2008-11-04 12:37       ` CRLF support bugs (was: Re: .gitattributes glob matchingbroken) Kelly F. Hickel
2008-11-05  3:07         ` Jeff King

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=83od0yaxzk.fsf@kalahari.s2.org \
    --to=azure@iki.fi \
    --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