Re: [PATCH 0/2] Making "git commit" to mean "git commit -a".

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Carl Worth
Date: Thursday, November 30, 2006 - 6:10 pm

On Thu, 30 Nov 2006 16:21:56 -0800 (PST), Linus Torvalds wrote:

Call me insane.

I think it is very strange that the following command sequences commit
different content for myfile:

	echo old > myfile
	git add myfile
	echo new > myfile
	git commit

compared to:

	echo old > myfile
	git add myfile
	echo new > myfile
	git commit myfile

The difference there is very subtle and really does prevent a
reasonable, "just ignore the index and you can use git comfortably".

Now, the behavior above can be explained. You and I both understand it
just fine. And Nico's proposed tutorial document even explains it,
(twists and all).

But it is strange, and I cannot see how the first case is at all useful.

The point is that by-and-large I don't ever want to commit anything
that is not present in my working tree at the time I type
"commit". That's precisely why I'm typing "commit" at that time.

If I do ever want to commit content that is not currently in my
working tree, then I should have to do something
exceptional. Otherwise, git will always have user-interface traps that
will trip people up.

You might point at my first example and say that the timing of my "git
add" command is the exceptional thing I did to trigger the old commit.
But the second command above destroys that explanation. In the second,
the timing of "git add" doesn't trigger any exceptional behavior at
all. The new content of the file is still committed.


You're explaining the behavior, but not providing any justification
for this being the right thing based on what a user actually wants to
do.

-Carl
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH 0/2] Making "git commit" to mean "git commit -a"., Carl Worth, (Thu Nov 30, 6:10 pm)