git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org, Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH v4 2/3] pretty: enable --expand-tabs by default for selected pretty formats
Date: Wed, 30 Mar 2016 12:18:24 -0700	[thread overview]
Message-ID: <xmqq37r7u64f.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20160330013851.GF2237@sigill.intra.peff.net> (Jeff King's message of "Tue, 29 Mar 2016 21:38:51 -0400")

Jeff King <peff@peff.net> writes:

> On Tue, Mar 29, 2016 at 04:15:08PM -0700, Junio C Hamano wrote:
>
>> diff --git a/Documentation/pretty-options.txt b/Documentation/pretty-options.txt
>> index 4fb5c76..23967b6 100644
>> --- a/Documentation/pretty-options.txt
>> +++ b/Documentation/pretty-options.txt
>> @@ -43,10 +43,16 @@ people using 80-column terminals.
>>  	commit may be copied to the output.
>>  
>>  --expand-tabs::
>> +--no-expand-tabs::
>>  	Perform a tab expansion (replace each tab with enough number
>>  	of spaces to fill to the next display column that is
>>  	multiple of 8) in the log message before using the message
>>  	to show in the output.
>> ++
>> +By default, tabs are expanded in pretty formats that indent the log
>> +message by 4 spaces (i.e.  'medium', which is the default, 'full',
>> +and "fuller').  `--no-expand-tabs` option can be used to disable
>> +this.
>
> Mismatched quote types on "fuller".

Thanks.

>> @@ -172,6 +173,7 @@ void get_commit_format(const char *arg, struct rev_info *rev)
>>  
>>  	rev->commit_format = commit_format->format;
>>  	rev->use_terminator = commit_format->is_tformat;
>> +	rev->expand_tabs_in_log = commit_format->expand_tabs_in_log;
>>  	if (commit_format->format == CMIT_FMT_USERFORMAT) {
>>  		save_user_format(rev, commit_format->user_format,
>>  				 commit_format->is_tformat);
>
> This feels like the wrong time to set the value in rev_info, as it means
> that:
>
>   git log --no-expand-tabs --pretty=full
>
> and
>
>   git log --pretty=full --no-expand-tabs
>
> behave differently.

I was sort of hoping that we can get away by defining that "an
explicit --pretty asks for the full behaviour of the format it
specifies, e.g. if you ask --pretty=medium, you are asking for
4-space indented tab-expanded log with the headers at the medium
level of detail".

> The other values set in get_commit_format, like "use_terminator",
> are inherently part of the format, but I don't think this is.

IOW, I was hoping nobody would agree with that and rather everybody
would consider tab-expansion is part of the format.

Let me try your way instead and report how it went when I send out a
reroll.

> Likewise, if we were to eventually add config like "[log]expandtab = 4",
> it should not be overridden by "--pretty=full" (but we probably _would_
> want to have it kick in only for certain formats).

This is exactly why I didn't do a configuration variable, as I think
we can make only 50% of people happy.  Some would say "when I
explicitly ask for the "email" format, I expect that expandtab
configuration gets ignored" while others would say "I said I want
expandtab in the configuration no matter what".

  reply	other threads:[~2016-03-30 19:18 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-16 16:29 [PATCH] pretty-print: de-tabify indented logs to make things line up properly Linus Torvalds
2016-03-16 16:52 ` Linus Torvalds
2016-03-16 18:01 ` Junio C Hamano
2016-03-16 18:21   ` Linus Torvalds
2016-03-16 19:32     ` Junio C Hamano
2016-03-16 19:47       ` Junio C Hamano
2016-03-16 19:59         ` Linus Torvalds
2016-03-16 21:37           ` Junio C Hamano
2016-03-16 22:04             ` Linus Torvalds
2016-03-17 23:13               ` [PATCH v2 1/4] " Junio C Hamano
2016-03-17 23:15                 ` [PATCH v2 2/4] pretty-print: simplify the interaction between pp_handle_indent() and its caller Junio C Hamano
2016-03-17 23:15                 ` [PATCH v2 3/4] pretty-print: further abstract out pp_handle_indent() Junio C Hamano
2016-03-17 23:16                 ` [PATCH 4/4] pretty-print: add --pretty=noexpand Junio C Hamano
2016-03-17 23:23                   ` Linus Torvalds
2016-03-17 23:40                     ` Junio C Hamano
2016-03-18  5:08                   ` Jeff King
2016-03-18  5:36                     ` Linus Torvalds
2016-03-18  5:55                       ` Jeff King
2016-03-18  5:44                     ` Junio C Hamano
2016-03-23 23:23                       ` [PATCH v3 0/5] Expanding tabs in "git log" output Junio C Hamano
2016-03-23 23:23                         ` [PATCH v3 1/5] pretty-print: de-tabify indented logs to make things line up properly Junio C Hamano
2016-03-23 23:23                         ` [PATCH v3 2/5] pretty-print: simplify the interaction between pp_handle_indent() and its caller Junio C Hamano
2016-03-23 23:23                         ` [PATCH v3 3/5] pretty-print: further abstract out pp_handle_indent() Junio C Hamano
2016-03-23 23:23                         ` [PATCH v3 4/5] pretty-print: limit expand-tabs to selected --pretty formats Junio C Hamano
2016-03-23 23:23                         ` [PATCH v3 5/5] pretty-print: teach "--no-expand-tabs" option to "git log" Junio C Hamano
2016-03-23 23:47                         ` [PATCH v3 0/5] Expanding tabs in "git log" output Linus Torvalds
2016-03-24  0:58                         ` Jeff King
2016-03-24  5:17                           ` Junio C Hamano
2016-03-24  7:05                         ` Torsten Bögershausen
2016-03-24 15:37                           ` Junio C Hamano
2016-03-24 18:22                           ` Junio C Hamano
2016-03-25  9:34                             ` Torsten Bögershausen
2016-03-25 14:13                               ` Torsten Bögershausen
2016-03-25 16:41                                 ` Junio C Hamano
2016-03-25 16:25                               ` Junio C Hamano
2016-03-29 23:15                         ` [PATCH v4 0/3] " Junio C Hamano
2016-03-29 23:15                           ` [PATCH v4 1/3] pretty: expand tabs in indented logs to make things line up properly Junio C Hamano
2016-03-30  0:17                             ` Eric Sunshine
2016-03-30 18:20                               ` Junio C Hamano
2016-03-29 23:15                           ` [PATCH v4 2/3] pretty: enable --expand-tabs by default for selected pretty formats Junio C Hamano
2016-03-30  1:38                             ` Jeff King
2016-03-30 19:18                               ` Junio C Hamano [this message]
2016-03-29 23:15                           ` [PATCH v4 3/3] pretty: allow tweaking tabwidth in --expand-tabs Junio C Hamano
2016-04-05  0:58                           ` [PATCH v5 0/4] Expanding tabs in "git log" output Junio C Hamano
2016-04-05  0:58                             ` [PATCH v5 1/4] pretty: expand tabs in indented logs to make things line up properly Junio C Hamano
2016-04-05  0:58                             ` [PATCH v5 2/4] pretty: enable --expand-tabs by default for selected pretty formats Junio C Hamano
2016-04-05  0:58                             ` [PATCH v5 3/4] pretty: allow tweaking tabwidth in --expand-tabs Junio C Hamano
2016-04-05  0:58                             ` [PATCH v5 4/4] pretty: test --expand-tabs Junio C Hamano
2016-04-05  1:10                               ` Eric Sunshine
2016-04-05  1:47                                 ` Jeff King
2016-04-05  6:25                                   ` Junio C Hamano
2016-04-05  1:52                               ` Jeff King
2016-04-05  6:32                                 ` Junio C Hamano
2016-04-05  7:13                                 ` Perry Hutchison
2016-04-05  1:53                             ` [PATCH v5 0/4] Expanding tabs in "git log" output Jeff King
2016-03-16 19:50       ` [PATCH] pretty-print: de-tabify indented logs to make things line up properly Linus Torvalds
2016-03-16 21:55         ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqq37r7u64f.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).