From: Julien Cretin <git@ia0.eu>
To: git@vger.kernel.org
Subject: git check-ignore returns included files
Date: Fri, 3 Jun 2016 14:48:52 +0000 (UTC) [thread overview]
Message-ID: <loom.20160603T164532-641@post.gmane.org> (raw)
Hello,
Is it expected for check-ignore to output included files (using a "!"
prefix)?
Steps to reproduce:
git init foo
cd foo
touch bar
echo '/bar\n!/bar' > .gitignore
git add bar .gitignore
git commit -mbar
git check-ignore --verbose --no-index bar
Actual behavior:
.gitignore:2:!/bar bar
exit code = 0
Expected behavior:
no output
exit code = 1
I tested with the next branch, which is currently at
8a191e187a9dca3d786c0197f9610e627b4f4137.
The man page of check-ignore says:
« For each pathname [...], check whether the file is excluded by
.gitignore [...] and output the path if it is excluded. »
and:
« If the pattern contained a ! prefix or / suffix, it will be
preserved in the output. »
The man page of gitignore says:
« An optional prefix "!" which negates the pattern; any matching file
excluded by a previous pattern will become included again. »
I am not sure how I should understand this situation.
Best regards,
Julien
reply other threads:[~2016-06-03 14:55 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=loom.20160603T164532-641@post.gmane.org \
--to=git@ia0.eu \
--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).