git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael J Gruber <michaeljgruber+gmane@fastmail.fm>
To: git@vger.kernel.org
Subject: gitignore: negating path patterns
Date: Wed, 21 May 2008 16:52:36 +0200	[thread overview]
Message-ID: <g11cvn$ndr$1@ger.gmane.org> (raw)

Hi there

It seems that negating path patterns in gitignore doesn't work, or I
don't understand it (or both). With the attached script, git status
(1.5.5.1) reports "dir/a" as new and "dir/b" as untracked. I would
rather expect it to report "dir/c" as untracked also.

It seems that "!b" matches to include "dir/b" (reverting the exclusion
"*" as expected), whereas "!dir/" does not match to include "dir/c".

What's going on here?

Michael

P.S.: "*" in dir/.gitignore would do what I want, but I want all
patterns in one place.

P.P.S.: My first attempt at sending this was blocked (by an MS CDO for 
Exchange 2000?! Is this gmane playing pranks on me?). So I'll resend 
with the script inline rather than attached.

---etest.sh---


#!/bin/sh
rm -Rf test
mkdir test
cd test
git init
mkdir dir
echo test > a
echo test > dir/a
echo test > dir/b
echo test > dir/c
git add dir/a
cat > .git/info/exclude <<EOF
*
!dir/
!b
EOF
git status

             reply	other threads:[~2008-05-21 14:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-21 14:52 Michael J Gruber [this message]
2008-05-23  0:23 ` gitignore: negating path patterns Kevin Ballard
2008-05-23  7:52   ` Michael J Gruber
2008-05-23 22:44     ` Kevin Ballard
2008-05-26  8:54       ` Michael J Gruber
  -- strict thread matches above, loose matches on Subject: below --
2008-05-21 14:40 Michael J Gruber

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='g11cvn$ndr$1@ger.gmane.org' \
    --to=michaeljgruber+gmane@fastmail.fm \
    --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;
as well as URLs for NNTP newsgroup(s).