Re: Two crazy proposals for changing git's diff commands
- From
Linus Torvalds <torvalds@osdl.org>
- Date
- Feb 9, 2006, 01:30 UTC
- Message-ID
- <Pine.LNX.4.64.0602081726390.2458@g5.osdl.org>
- In-Reply-To
- <7vfymtl43b.fsf@assigned-by-dhcp.cox.net>
On Wed, 8 Feb 2006, Junio C Hamano wrote:
> > So we could even implement that with > > $ git commit --preview [other flags] [paths...]
My argument for "git status" was that it very much _is_ about "what would I commit". So I'd much rather extend on "git status" than add a "--preview" flag to "git commit".
At least to me, "git status" is very much a "what is pending" kind of command. The fact that you can't con it into giving a diff is actually a downside: I would at times have preferred to have the "git commit" message contain an extended status that contained the diffs too.
Another way of saying that: I think it would make sense to have a verbose status report, and maybe also have that verbose flag passed into "git commit" so that you can see the verbose status when you edit the commit message.
Under that logic, "git status -v" would show all the diffs (not just filenames) and "git commit -v .." would be the same as "git commit .." but the "-v" flag would have been passed down to the "git status" call, so the commit message file would be pre-populated with the diff.
For small commits, it's actually nice to see the diff itself as you write the commit message.
Linus