Re: [PATCH] for-each-ref: add option to omit newlines

2014-02-14 Thread Junio C Hamano
Øystein Walle writes: > Maybe it's all subjective... I'm okay with just leaving things as they > are. Lack of "-z" in for-each-ref can be called an inconsistency that already exists you may want to fix in any case. As an extension to that, I would not be fundamentally against a new option, e.g.

Re: [PATCH] for-each-ref: add option to omit newlines

2014-02-14 Thread Øystein Walle
Junio C Hamano pobox.com> writes: > > I very well understand that. All other commands that support "-z" > to give you NUL terminated output do not consider that a downside. > Why should for-each-ref be special? > After I discovered log also has this there is nothing special about for-each-ref

Re: [PATCH] for-each-ref: add option to omit newlines

2014-02-14 Thread Junio C Hamano
Øystein Walle writes: > However, when specifying a format string it's just a matter of ending > the format string in '%00' and you're good to go. But then you get the > null byte *and* a newline. And with your proposal there would be no way > of saying you want neither. I very well understand th

Re: [PATCH] for-each-ref: add option to omit newlines

2014-02-14 Thread Øystein Walle
Junio C Hamano pobox.com> writes: > > I would rather see us go in the direction to add "-z" output option, > which is what everybody else that produces NUL terminated entries in > our suite of subcommands does. > I agree that -z would help in this case and I very much appreciate that option wh

Re: [PATCH] for-each-ref: add option to omit newlines

2014-02-13 Thread Junio C Hamano
Øystein Walle writes: > On to the patch itself: I contemplated putting '\n' in the default format and > removing it if -n was given, which would get rid of the need to pass an exta > argument to show_ref(). But that means we would need to *insert it* when a > format is given and -n is not... I w

Re: [PATCH] for-each-ref: add option to omit newlines

2014-02-13 Thread Øystein Walle
Øystein Walle gmail.com> writes: > > splitting the output on newlines, for example. > Ugh, I mean on null bytes, naturally. Øsse. -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kerne

[PATCH] for-each-ref: add option to omit newlines

2014-02-13 Thread Øystein Walle
Even when having specified a format string for-each-ref still prints a newline after printing each ref according to the format. This breaks splitting the output on newlines, for example. Signed-off-by: Øystein Walle --- I was somewhat surprised by this behaviour; I expected to be in full control