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
Linus Torvalds <torvalds@osdl.org>
Date
Dec 19, 2006, 19:04 UTC
Message-ID
<Pine.LNX.4.64.0612191101490.3483@woody.osdl.org>
In-Reply-To
<7vy7p3pxyr.fsf@assigned-by-dhcp.cox.net>
On Tue, 19 Dec 2006, Junio C Hamano wrote:
Show 9 quoted lines
> Andy Parkins <andyparkins@gmail.com> writes:
> 
> > 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?

I don't know about "rely", but yes, it's what I normally do. When I import a tar-ball, I'll just do

	..untar..
	cd result-x.y.z
	git init-db
	git add
	git commit
and I don't usually use the "." at all, since it's unnecessary.

But hey, if it enters some interactive mode, maybe I can teach myself to either just do "git add .", or if the interactive mode has a choice of "a" for "all", then why not?

Show 5 quoted lines
> 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).

That's a really good argument against the current behaviour of "git add", so while I actually use it without any parameters, I will concur that we should probably change it.

Previous: Junio C Hamano
Message 4 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.