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

[PATCH] git-add: warn when adding an ignored file with an explicit request.

From
Junio C Hamano <junkio@cox.net>
Date
Dec 25, 2006, 18:39 UTC
Message-ID
<7vodprizuw.fsf_-_@assigned-by-dhcp.cox.net>
In-Reply-To
<7vslf3khsc.fsf@assigned-by-dhcp.cox.net>

We allow otherwise ignored paths to be added to the index by spelling its path out on the command line, but we would warn the user about them when we do so.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
 * This is on top of what I sent out last night.
 builtin-add.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/builtin-add.c b/builtin-add.c
index 822075a..c54c694 100644
--- a/builtin-add.c
+++ b/builtin-add.c
@@ -37,6 +37,9 @@ static void prune_directory(struct dir_struct *dir, const char **pathspec, int p
 			free(entry);
 			continue;
 		}
+		if (entry->ignored_entry)
+			fprintf(stderr, "warning: '%s' is an ignored path.\n",
+				entry->name);
 		*dst++ = entry;
 	}
 	dir->nr = dst - dir->entries;
-- 
1.4.4.3.g71b5
Previous: Junio C HamanoNext: Jakub Narebski
Message 4 of 11 in “git-add: add ignored files when asked explicitly.”
  1. 5/5 git-add: add ignored files when asked explicitly.Junio C Hamano, Dec 25, 2006
  2. Johannes SchindelinDec 25, 2006
  3. Junio C HamanoDec 25, 2006
  4. git-add: warn when adding an ignored file with an explicit request.Junio C Hamano, Dec 25, 2006
  5. Jakub NarebskiDec 25, 2006
  6. Johannes SchindelinDec 26, 2006
  7. Nicolas PitreDec 25, 2006
  8. Johannes SchindelinDec 26, 2006
  9. Junio C HamanoDec 26, 2006
  10. Johannes SchindelinDec 26, 2006
  11. Andreas EricssonJan 4, 2007

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.