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

Re: [PATCH] gitignore(5): Allow "foo/" in ignore list to match directory "foo"

From
APAdam Piatyszek <ediap@users.sourceforge.net>
Date
Jan 31, 2008, 12:29 UTC
Message-ID
<47A1BF27.7080802@users.sourceforge.net>
In-Reply-To
<alpine.LSU.1.00.0801311128190.23907@racer.site>
* Johannes Schindelin [31 I 2008 12:38]:
Show 11 quoted lines
> Just to add my two eurocents: I think the patch is complicated enough that 
> we could go the other way round: while parsing the ignore entries, we can 
> plainly state that entries with a trailing slash are ignored:
> 
> -- snipsnap --
> [PATCH] Warn if an ignore/exclude entry ends in a slash
> 
> Git does not like ignore entries ending in a slash; they will be ignored.
> So just be honest and warn the user about it.
> 
> Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
I agree that this is a reasonable remedy for this issue. So:
Acked-by: Adam Piątyszek <ediap@users.sourceforge.net>

BTW, the warning message is a bit "hidden" between the "Changed" and "Untracked" parts of a status message, e.g.:

===== >8 ===== # On branch master # Changed but not updated: # (use "git add <file>..." to update what will be committed) # # modified: src/Makefile # modified: src/ofdm.cpp # warning: Ignoring ignore entry because of trailing slash: results/ # Untracked files: # (use "git add <file>..." to include in what will be committed) # # results/ no changes added to commit (use "git add" and/or "git commit -a") ===== >8 =====

Is it possible to make warnings displayed in red or yellow colour on terminals that support colours?

BR, /Adam

-- 
.:.  Adam Piatyszek (ediap)  .:.....................................:.
.:.  ediap@users.sourceforge.net  .:................................:.
Previous: Andreas EricssonNext: Wayne Davison
Message 19 of 20 in “Why does git track directory listed in .gitignore/".git/info/exclude"?”
  1. pradeep singh rautelaJan 23, 2008
  2. pradeep singh rautelaJan 23, 2008
  3. Linus TorvaldsJan 23, 2008
  4. pradeep singh rautelaJan 24, 2008
  5. Adam PiatyszekJan 30, 2008
  6. Junio C HamanoJan 30, 2008
  7. Junio C HamanoJan 30, 2008
  8. Adam PiatyszekJan 31, 2008
  9. *Re: Why does git track directory listed in .gitignore/".git/info/exclude"?Junio C Hamano, Jan 31, 2008
  10. gitignore(5): Allow "foo/" in ignore list to match directory "foo"Junio C Hamano, Jan 31, 2008
  11. Jeff KingJan 31, 2008
  12. Junio C HamanoJan 31, 2008
  13. Jeff KingJan 31, 2008
  14. Johannes SchindelinJan 31, 2008
  15. pradeep singh rautelaJan 31, 2008
  16. Junio C HamanoJan 31, 2008
  17. Adam PiatyszekJan 31, 2008
  18. Andreas EricssonFeb 1, 2008
  19. Adam PiatyszekJan 31, 2008
  20. Wayne DavisonJan 23, 2008

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.