Re: [PATCH 4/4] pretty-print: add --pretty=noexpand

2016-03-19 Thread Linus Torvalds
On Thu, Mar 17, 2016 at 10:08 PM, Jeff King  wrote:
>
> Hmm. Isn't "expand tabs" orthogonal to the rest of the pretty format?
> That is, couldn't one want "--pretty=fuller, but with tabs expanded"?

Yeah, you are right, one easily could. And in fact I end up doing
"fuller" myself occasionally, because I check peoples commit
timestamps (some people have a nasty habit of rebasing when they
shouldn't).

So it's not just the medium format that would want detab by default,
it's "full" and "fuller" too (but probably not "raw": that indents the
message too, but the only real reason to use "raw" is for scripting).

So it would probably be better to make it a separate flag, and not tie
it to a particular log format (and just make the log format set the
default).

   Linus
--
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.kernel.org/majordomo-info.html


Re: [PATCH 4/4] pretty-print: add --pretty=noexpand

2016-03-19 Thread Junio C Hamano
Jeff King  writes:

> E.g., start with:
>
>   - only CMIT_FMT_MEDIUM expands tabs (and does so by default)
>
>   - passing --no-expand-tabs suppresses this behavior
>
>   - passing --expand-tabs is an error for now; if people care later,
> they can add support for other formats (naively this is trivial, but
> I suspect there are some corner cases around things like
> --pretty=raw, so unless somebody wants to work on it now, I don't
> think we need to).

Yup, I like that better, but it is now past my work hours, so I
won't be looking at it right now.


--
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.kernel.org/majordomo-info.html


Re: [PATCH 4/4] pretty-print: add --pretty=noexpand

2016-03-19 Thread Junio C Hamano
Linus Torvalds  writes:

> On Thu, Mar 17, 2016 at 4:16 PM, Junio C Hamano  wrote:
>> It is reasonable for tweak the default output mode for "git log" to
>> untabify the commit log message, it sometimes may be necessary to
>> see the output without tab expansion.
>
> Thanks, these all look good to me.
>
> Sorry for not following up, it's just that I'm in the middle of the
> kernel merge window and haven't had the time to worry about it.

Sorry is mutual; I would have done this much earlier if I didn't
have the four-maintenance-tracks-at-the-same-time release today ;-)
--
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.kernel.org/majordomo-info.html


Re: [PATCH 4/4] pretty-print: add --pretty=noexpand

2016-03-19 Thread Jeff King
On Thu, Mar 17, 2016 at 10:36:16PM -0700, Linus Torvalds wrote:

> On Thu, Mar 17, 2016 at 10:08 PM, Jeff King  wrote:
> >
> > Hmm. Isn't "expand tabs" orthogonal to the rest of the pretty format?
> > That is, couldn't one want "--pretty=fuller, but with tabs expanded"?
> 
> Yeah, you are right, one easily could. And in fact I end up doing
> "fuller" myself occasionally, because I check peoples commit
> timestamps (some people have a nasty habit of rebasing when they
> shouldn't).
> 
> So it's not just the medium format that would want detab by default,
> it's "full" and "fuller" too (but probably not "raw": that indents the
> message too, but the only real reason to use "raw" is for scripting).
> 
> So it would probably be better to make it a separate flag, and not tie
> it to a particular log format (and just make the log format set the
> default).

Yeah, I agree with all of that. I didn't want to force anybody to have
to think too hard about corner cases they don't care about (again, as
long as we don't paint ourselves into a corner) but I tend to think that
it makes sense to apply it consistently to all of the stock
human-readable formats (short, medium, full, fuller), but not to "raw"
or "email", and probably not to user-formats.

-Peff
--
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.kernel.org/majordomo-info.html


Re: [PATCH 4/4] pretty-print: add --pretty=noexpand

2016-03-19 Thread Jeff King
On Thu, Mar 17, 2016 at 04:16:21PM -0700, Junio C Hamano wrote:

> It is reasonable for tweak the default output mode for "git log" to
> untabify the commit log message, it sometimes may be necessary to
> see the output without tab expansion.
> 
> Invent a new --pretty option to do this.  Use this to unbreak the
> test breakages, where "git shortlog" and output are tested.

Hmm. Isn't "expand tabs" orthogonal to the rest of the pretty format?
That is, couldn't one want "--pretty=fuller, but with tabs expanded"?

I don't personally care much myself, and certainly we don't need to
support "--expand-tabs" for every format until somebody actually wants
them enough to implement it. I just don't want to see us painted into a
corner where we have to support an awkward interface forever (e.g., the
way we had to retrofit the orthogonal "local" concept onto the --date
code).

E.g., start with:

  - only CMIT_FMT_MEDIUM expands tabs (and does so by default)

  - passing --no-expand-tabs suppresses this behavior

  - passing --expand-tabs is an error for now; if people care later,
they can add support for other formats (naively this is trivial, but
I suspect there are some corner cases around things like
--pretty=raw, so unless somebody wants to work on it now, I don't
think we need to).

-Peff
--
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.kernel.org/majordomo-info.html


Re: [PATCH 4/4] pretty-print: add --pretty=noexpand

2016-03-19 Thread Linus Torvalds
On Thu, Mar 17, 2016 at 4:16 PM, Junio C Hamano  wrote:
> It is reasonable for tweak the default output mode for "git log" to
> untabify the commit log message, it sometimes may be necessary to
> see the output without tab expansion.

Thanks, these all look good to me.

Sorry for not following up, it's just that I'm in the middle of the
kernel merge window and haven't had the time to worry about it.

Linus
--
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.kernel.org/majordomo-info.html