git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Bug: git add does not process gitignore properly
@ 2023-06-22 19:38 David C Black
  2023-06-23 22:07 ` Eric Sunshine
  0 siblings, 1 reply; 4+ messages in thread
From: David C Black @ 2023-06-22 19:38 UTC (permalink / raw)
  To: git@vger.kernel.org

Thank you for filling out a Git bug report!
Please answer the following questions to help us understand your issue.
 
What did you do before the bug happened?
 
Sitting at the rood of my working directory I attempted to add a file to the git repository with:
 
> git add extern/bin/build
 
The repository had the following .gitignore file contents:
 
> /extern/
> !/extern/bin/
> !/extern/ABOUT.md
 
What did you expect to happen? (Expected behavior)
 
I expected it to be added.
 
What happened instead? (Actual behavior)
 
I received an error message:
 
> The following paths are ignored by one of your .gitignore files:
> extern
> hint: Use -f if you really want to add them.
> hint: Turn this message off by running
> hint: "git config advice.addIgnoredFile false"
 
What's different between what you expected and what actually happened?
 
By negating entries in the /extern/bin/ directory, I did not expect an error
message. Of course adding -f made it work, but I think it does not match the
described behavior for this tool.
 
Anything else you want to add:
 
Please review the rest of the bug report below.
You can delete any lines you don't wish to share.
 
[System Info]
git version:
git version 2.41.0
cpu: arm64
no commit associated with this build
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
feature: fsmonitor--daemon
uname: Darwin 22.5.0 Darwin Kernel Version 22.5.0: Mon Apr 24 20:52:24 PDT 2023; root:xnu-8796.121.2~5/RELEASE_ARM64_T6000 arm64
compiler info: clang: 14.0.3 (clang-1403.0.22.14.1)
libc info: no libc information available
$SHELL (typically, interactive shell): /bin/zsh
 
 
[Enabled Hooks]
 
-- 
David C. Black, Electronics/Programming Technology Instructor

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-06-24 22:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-22 19:38 Bug: git add does not process gitignore properly David C Black
2023-06-23 22:07 ` Eric Sunshine
2023-06-24 10:13   ` Phillip Wood
2023-06-24 22:19     ` Junio C Hamano

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