git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felipe Contreras <felipe.contreras@gmail.com>
To: git@vger.kernel.org
Cc: Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Junio C Hamano <gitster@pobox.com>,
	Felipe Contreras <felipe.contreras@gmail.com>
Subject: Re: [PATCH v2 2/8] config: Reorganize get_color*.
Date: Tue, 17 Feb 2009 03:00:20 +0200	[thread overview]
Message-ID: <94a0d4530902161700n734b1ee0p22672757b978b850@mail.gmail.com> (raw)
In-Reply-To: <1234832094-15541-2-git-send-email-felipe.contreras@gmail.com>

On Tue, Feb 17, 2009 at 2:54 AM, Felipe Contreras
<felipe.contreras@gmail.com> wrote:
> In preparation for parseopt.
>
> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
> ---

<snip/>

> @@ -274,12 +237,11 @@ static int get_colorbool(int argc, const char **argv)
>                        get_colorbool_found = git_use_color_default;
>        }
>
> -       if (argc == 1) {
> -               return get_colorbool_found ? 0 : 1;
> -       } else {
> +       if (print) {
>                printf("%s\n", get_colorbool_found ? "true" : "false");
>                return 0;
> -       }
> +       } else
> +               return get_colorbool_found ? 0 : 1;
>  }

<snip/>

>                } else if (!strcmp(argv[1], "--get-colorbool")) {
> -                       return get_colorbool(argc-2, argv+2);
> +                       if (argc == 4)
> +                               stdout_is_tty = git_config_bool("command line", argv[3]);
> +                       else if (argc == 3)
> +                               stdout_is_tty = isatty(1);
> +                       else
> +                               usage(git_config_set_usage);
> +                       get_colorbool_slot = argv[2];
> +                       return get_colorbool(argc == 3);

Agh, crap, that should be argc != 3. Anyway, the next patch does it properly.

-- 
Felipe Contreras

  parent reply	other threads:[~2009-02-17  1:01 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-17  0:54 [PATCH v2 1/8] config: Trivial rename in preparation for parseopt Felipe Contreras
2009-02-17  0:54 ` [PATCH v2 2/8] config: Reorganize get_color* Felipe Contreras
2009-02-17  0:54   ` [PATCH v2 3/8] config: Use parseopt Felipe Contreras
2009-02-17  0:54     ` [PATCH v2 4/8] config: Disallow multiple variable types Felipe Contreras
2009-02-17  0:54       ` [PATCH v2 5/8] config: Disallow multiple config file locations Felipe Contreras
2009-02-17  0:54         ` [PATCH v2 6/8] config: Don't allow extra arguments for -e or -l Felipe Contreras
2009-02-17  0:54           ` [PATCH v2 7/8] config: Codestyle cleanups Felipe Contreras
2009-02-17  0:54             ` [PATCH v2 8/8] config: Cleanup editor action Felipe Contreras
2009-02-17  2:28               ` Junio C Hamano
2009-02-17  2:24       ` [PATCH v2 4/8] config: Disallow multiple variable types Junio C Hamano
2009-02-17  2:24     ` [PATCH v2 3/8] config: Use parseopt Junio C Hamano
2009-02-17 13:55       ` Felipe Contreras
2009-02-17  5:44     ` Junio C Hamano
2009-02-17 10:35       ` Felipe Contreras
2009-02-17 11:55         ` Johannes Schindelin
2009-02-17 13:21           ` Felipe Contreras
2009-02-17  1:00   ` Felipe Contreras [this message]
2009-02-17  2:24   ` [PATCH v2 2/8] config: Reorganize get_color* Junio C Hamano
2009-02-17  1:45 ` [PATCH v2 1/8] config: Trivial rename in preparation for parseopt Junio C Hamano
2009-02-17  2:42   ` Felipe Contreras
2009-02-17 12:01     ` Johannes Schindelin
2009-02-17 13:59       ` Felipe Contreras
2009-02-17  9:00   ` Gerrit Pape
2009-02-17 11:58     ` Johannes Schindelin

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=94a0d4530902161700n734b1ee0p22672757b978b850@mail.gmail.com \
    --to=felipe.contreras@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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.
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 NNTP newsgroup(s).