public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Michael J Gruber <git@drmicha•warpmail.net>
To: Junio C Hamano <gitster@pobox•com>
Cc: Git Mailing List <git@vger•kernel.org>
Subject: Re: [RFC/PATCH 2/2] status -s: obey color.status
Date: Fri, 27 Nov 2009 10:17:00 +0100	[thread overview]
Message-ID: <4B0F990C.2010805@drmicha.warpmail.net> (raw)
In-Reply-To: <7vws1cwnu0.fsf@alter.siamese.dyndns.org>

Junio C Hamano venit, vidit, dixit 27.11.2009 06:15:
> Michael J Gruber <git@drmicha•warpmail.net> writes:
> 
>> * Should I rename wt-status.c's color() into something more unique when
>>   I export it?
> 
> Is it an option to instead move short_unmerged(), short_status() and
> friends to wt-status.c from builtin-commit.c?  It's been quite a while
> since I worked on the code, so I don't recall why it needs such cross
> references at low level between two files.

I didn't notice, but I'll look into it during the rewrite.

>> * Is there any policy regarding use of putchar/puts vs. printf?
> 
> J6t addressed it.  You have mixture of putchar(' ') and printf(" ") which
> looks somewhat funny ;-)

;) I'm happy with printf("c"), I just thought someone would find printf
overkill for a format less char.

>> * The way it is done now I "color" a space, otherwise one would need to
>>   break down the print statements even more. Since we always color the
>>   foreground only it is no problem, is it?
> 
> Some people do configure to use "reverse".  For example, I have:
> 
>     [diff.color]
>             old = red reverse
>             whitespace = blue reverse
> 
>     [status.color]
>             updated = green
>             changed = red
>             untracked = blue reverse
> 
> The output should be consistent between long and short format (I do not
> offhand recall what we do for the long format, though).

Oh, I didn't know about reverse. In this case I have to change the code
and leave the space alone. (The one between ?? and the filename.) Will do.

In the long format, only the file name is colored. Note that in the
short format, it does not make sense to color the file name because one
line may represent two pieces of status information. That is why I color
the two status letters and not the file name.

Michael

      reply	other threads:[~2009-11-27  9:18 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-26 15:24 [RFC/PATCH 0/2] status -s: Use the same config as status Michael J Gruber
2009-11-26 15:24 ` [RFC/PATCH 1/2] status -s: respect the status.relativePaths option Michael J Gruber
2009-11-27  3:15   ` Junio C Hamano
2009-11-27  7:05   ` Jeff King
2009-11-26 15:24 ` [RFC/PATCH 2/2] status -s: obey color.status Michael J Gruber
2009-11-26 15:36   ` Johannes Sixt
2009-11-26 16:03     ` Michael J Gruber
2009-11-26 19:00     ` Junio C Hamano
2009-11-27  7:00       ` [PATCH] Add a notice that only certain functions can print color escape codes Johannes Sixt
2009-11-27  7:30         ` Junio C Hamano
2009-11-27  7:42           ` Johannes Sixt
2009-11-27  9:22             ` Michael J Gruber
2009-11-27  5:15   ` [RFC/PATCH 2/2] status -s: obey color.status Junio C Hamano
2009-11-27  9:17     ` Michael J Gruber [this message]

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

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

  git send-email \
    --in-reply-to=4B0F990C.2010805@drmicha.warpmail.net \
    --to=git@drmicha$(echo .)warpmail.net \
    --cc=git@vger$(echo .)kernel.org \
    --cc=gitster@pobox$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox