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

Re: How to find out which gitignore blocks my git-add

From
Jeff King <peff@peff.net>
Date
Feb 7, 2009, 06:42 UTC
Message-ID
<20090207064221.GA14856@coredump.intra.peff.net>
In-Reply-To
<slrngopp7n.his.sitaramc@sitaramc.homelinux.net>
On Sat, Feb 07, 2009 at 01:33:43AM +0000, Sitaram Chamarty wrote:
Show 7 quoted lines
> > I think it might be useful to be able to get this information. However,
> > rather than coupling it with "git add", it might make more sense to have
> > a separate way to query "is this being ignored, and if so, by what
> > pattern". Then you could use that tool to generally debug your
> > .gitignore patterns.
> 
> maybe GIT_TRACE could print that as well, in some way?

It could, but I think reusing GIT_TRACE isn't a good idea. Currently it traces _just_ exec information, so I wouldn't want to pollute that with this information. But yes, you could trigger it through an environment variable, which would let us dump at the lowest level.

I spent a few minutes checking this out, and it looks to be a little more complex than I had hoped, just because we don't have all of the information in the same place at the same time.

A toy patch series follows; see 2/2 for a description of why it doesn't work like you might hope. I'm not too interested in trying to deal with the refactoring that would be required to do it right. But maybe somebody else is.

-Peff
Previous: Sitaram ChamartyNext: Jeff King
Message 4 of 17 in “How to find out which gitignore blocks my git-add”
  1. GonzoFeb 6, 2009
  2. Jeff KingFeb 6, 2009
  3. Sitaram ChamartyFeb 7, 2009
  4. Jeff KingFeb 7, 2009
  5. 1/2 refactor exclude handlingJeff King, Feb 7, 2009
  6. 2/2 give exclude mechanism a debug optionJeff King, Feb 7, 2009
  7. Junio C HamanoFeb 7, 2009
  8. Junio C HamanoFeb 7, 2009
  9. Jeff KingFeb 7, 2009
  10. Jeff KingFeb 7, 2009
  11. Junio C HamanoFeb 7, 2009
  12. Jeff KingFeb 8, 2009
  13. Junio C HamanoFeb 8, 2009
  14. Jeff KingFeb 8, 2009
  15. Sitaram ChamartyFeb 7, 2009
  16. Jeff KingFeb 7, 2009
  17. bisaniFeb 6, 2009

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.