Re: [PATCH] git-diff-*: Allow --name-only -z as alias for --name-only-z

2005-07-14 Thread Matthias Urlichs
Hi,

Junio C Hamano:
 I've considered it, but what happens if you give -z first and
 then name-only?
 
Exactly the same thing as vice versa.
Or, even more exactly, my patch *makes* that happen. ;-)

-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  [EMAIL PROTECTED]
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
 - -
Isn't this a beautiful day! Just watch some bastard louse it up.


signature.asc
Description: Digital signature


Re: [PATCH] git-diff-*: Allow --name-only -z as alias for --name-only-z

2005-07-14 Thread Matthias Urlichs
Hi,

Junio C Hamano:
 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 saw the problem...
 
 Hmm?
 
Sure -- assuming I find some time to actually do it over the next few days.

The problem is that this has been a problem lately. :-/

-- 
Matthias Urlichs   |   {M:U} IT Design @ m-u-it.de   |  [EMAIL PROTECTED]
Disclaimer: The quote was selected randomly. Really. | http://smurf.noris.de
 - -
Illiterate?  Write today, for free help!


signature.asc
Description: Digital signature


Re: [PATCH] git-diff-*: Allow --name-only -z as alias for --name-only-z

2005-07-14 Thread Linus Torvalds


On Thu, 14 Jul 2005, Junio C Hamano wrote:
 
 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
-
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html