Re: [PATCH] git-diff-*: Allow "--name-only -z" as alias for "--name-only-z"
- From
Linus Torvalds <torvalds@osdl.org>
- Date
- Jul 15, 2005, 05:12 UTC
- Message-ID
- <Pine.LNX.4.58.0507142205580.19183@g5.osdl.org>
- In-Reply-To
- <7vmzop56fo.fsf@assigned-by-dhcp.cox.net>
On Thu, 14 Jul 2005, Junio C Hamano wrote:
Show 5 quoted lines
> > That said, I have been hating that diff options parsing for > quite a while, and I've been thinking about cleaning it up along > the lines I'll outline here, but have not done anything about > it. Care to help me out?
I didn't do what you suggested, but I _did_ split the "format" up into "format + line_termination", which in my opinion cleaned up part of it a _lot_.
So now "-z" only sets "line_termination" to NUL. "format" starts out as "DIFF_FORMAT_RAW" (which is the old HUMAN/MACHINE format - the difference between those two are now the line termination) but can be "PATCH" and "NAME".
Now, DIFF_FORMAT_PATCH + -z wouldn't seem to make any sense at all, but you can actually do so, and it actually makes some amount of sense for the case of
git-diff-tree -v -p -z HEAD
where the "-z" means that the commit _message_ will be terminated by a NUL character, while the "-v" obviously means that the commit message will be printed at all, and the "-p" means that the diff gets printed as a patch.
But the diff obviously gets printed with newlines (as does any newlines _within_ the commit message), not with lines terminated by NUL's.
So "--name-only-z" no longer exists. It's "-z --name-only" (in any order, quite naturally).
Linus