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

Re: [PATCH] Enter interactive mode if no parameters are given to git-add

From
Junio C Hamano <junkio@cox.net>
Date
Dec 19, 2006, 18:00 UTC
Message-ID
<7vy7p3pxyr.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<200612191516.09606.andyparkins@gmail.com>
Andy Parkins <andyparkins@gmail.com> writes:
Show 5 quoted lines
> git-add with no parameters previously adds every modified file.  This
> patch instead makes git-add enter interactive mode.
> ...
> It seemed a bit nasty to add content without explicit instructions to do
> so.
Does anybody rely on the current behaviour?

It is nasty and I consider it a bug. It appears that it has been like that since the days when it was still a shell script.

While I think nobody should drive 'git add' from script, the behaviour to add everything when there is no explicit parameter (or fall back to interactive for that matter) has a problem if you say "some command | xargs git-add --" (you need "xargs -r" to fix it, which is GNU).

Let's first have a patch to exit with a warning message (but status 0) without doing anything when there is no explicit paths.

Again, does anybody rely on the current behaviour?
Previous: Jakub NarebskiNext: Linus Torvalds
Message 3 of 4 in “Enter interactive mode if no parameters are given to git-add”
  1. Enter interactive mode if no parameters are given to git-addAndy Parkins, Dec 19, 2006
  2. Jakub NarebskiDec 19, 2006
  3. Junio C HamanoDec 19, 2006
  4. Linus TorvaldsDec 19, 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.