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

Re: Do "git add" as a builtin

From
Junio C Hamano <junkio@cox.net>
Date
May 17, 2006, 19:06 UTC
Message-ID
<7vhd3ocvyy.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.64.0605170927050.10823@g5.osdl.org>
Linus Torvalds <torvalds@osdl.org> writes:
> ... I dropped the strange "--error-unmatch" test, because it
> was really ugly and I didn't see the point.

By "not seeing the point", do you mean you do not agree with what bba319b5 and 45e48120 tried to do to help users?

        $ git add no-such-path-in-the-tree
        $ git add 'this-pattern-matches-nobody*'
More realistically:
	$ git add Documentaiton		;# misspelled
[References]

(bba319b5) When you say "git commit Documentaiton" to make partial commit for the files only in that directory, we did not detect that as a misspelled pathname and attempted to commit index without change. If nothing matched, there is no harm done, but if the index gets modified otherwise by having another valid pathspec or after an explicit update-index, a user will not notice without paying attention to the "git status" preview.

This introduces --error-unmatch option to ls-files, and uses it to detect this common user error.

(45e48120) This is in the same spirit as an earlier patch for git-commit. It does an extra ls-files to avoid complaining when a fully tracked directory name is given on the command line (otherwise --others restriction would say the pathspec does not match).

Previous: Linus TorvaldsNext: Linus Torvalds
Message 2 of 13 in “Do "git add" as a builtin”
  1. Linus TorvaldsMay 17, 2006
  2. Junio C HamanoMay 17, 2006
  3. Linus TorvaldsMay 17, 2006
  4. Junio C HamanoMay 18, 2006
  5. Junio C HamanoMay 18, 2006
  6. [WARNING] Please be careful when using "git add" from "next" branchJunio C Hamano, May 18, 2006
  7. FIXED: [WARNING] Please be careful when using "git add" from "next" branchJunio C Hamano, May 19, 2006
  8. Linus TorvaldsMay 18, 2006
  9. Linus TorvaldsMay 18, 2006
  10. Linus TorvaldsMay 18, 2006
  11. Junio C HamanoMay 18, 2006
  12. Linus TorvaldsMay 18, 2006
  13. Linus TorvaldsMay 18, 2006

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.