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

Re Is Git Add Supposed to Work Like This (git 2.50)?

From
K Jayatheerth <jayatheerthkulkarni2005@gmail.com>
Date
Sep 7, 2025, 08:10 UTC
Message-ID
<20250907081014.17466-1-jayatheerthkulkarni2005@gmail.com>
In-Reply-To
<63045080-74d6-4835-9d9c-4d3558acdbfb@gmail.com>
To answer very shortly, "It is intended"

Reason: I don't exactly know if I am pointing to the right code lines

But if you dig into builtin/add.c you will find these lines
	/*
	 * Check the "pathspec '%s' did not match any files" block
	 * below before enabling new magic.
	 */
	parse_pathspec(&pathspec, 0,
		       PATHSPEC_PREFER_FULL |
		       PATHSPEC_SYMLINK_LEADING_PATH,
		       prefix, argv);

If you read the comment you will know this is already intented (the behaviour which you described)

- Jayatheerth
Previous: Jon ForrestNext: Jeff King
Message 2 of 9 in “Is Git Add Supposed to Work Like This (git 2.50)?”
  1. Jon ForrestSep 7, 2025
  2. Re Is Git Add Supposed to Work Like This (git 2.50)?K Jayatheerth, Sep 7, 2025
  3. Jeff KingSep 7, 2025
  4. Jon ForrestSep 9, 2025
  5. Jon ForrestSep 9, 2025
  6. Jeff KingSep 9, 2025
  7. Junio C HamanoSep 9, 2025
  8. Jeff KingSep 9, 2025
  9. Jeff KingSep 9, 2025

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.