From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-3.7 required=3.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id 1E408200B9 for ; Mon, 7 May 2018 01:52:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751861AbeEGBwu (ORCPT ); Sun, 6 May 2018 21:52:50 -0400 Received: from mout.gmx.net ([212.227.15.15]:47953 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751444AbeEGBwt (ORCPT ); Sun, 6 May 2018 21:52:49 -0400 Received: from [10.40.94.26] ([209.226.201.248]) by mail.gmx.com (mrgmx003 [212.227.17.190]) with ESMTPSA (Nemesis) id 0LskfZ-1eDL121swD-012Kbq; Mon, 07 May 2018 03:52:38 +0200 Date: Sun, 6 May 2018 21:52:32 -0400 (DST) From: Johannes Schindelin X-X-Sender: virtualbox@gitforwindows.org To: Todd Zullinger cc: git@vger.kernel.org, Junio C Hamano , Thomas Rast , Thomas Gummerer , =?UTF-8?Q?=C3=86var_Arnfj=C3=B6r=C3=B0_Bjarmason?= , Ramsay Jones , Stefan Beller , Jacob Keller , Eric Sunshine Subject: Re: [PATCH v2 12/18] branch-diff: use color for the commit pairs In-Reply-To: <20180505234852.GR26695@zaya.teonanacatl.net> Message-ID: References: <20180505234852.GR26695@zaya.teonanacatl.net> User-Agent: Alpine 2.21.1 (DEB 209 2017-03-23) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Provags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PkaCJABhTH5SeGB71 ppE5sP7 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Hi Todd, On Sat, 5 May 2018, Todd Zullinger wrote: > > @@ -430,6 +451,8 @@ int cmd_branch_diff(int argc, const char **argv, const char *prefix) > > struct string_list branch1 = STRING_LIST_INIT_DUP; > > struct string_list branch2 = STRING_LIST_INIT_DUP; > > > > + git_diff_basic_config("diff.color.frag", "magenta", NULL); > > + > > diff_setup(&diffopt); > > diffopt.output_format = DIFF_FORMAT_PATCH; > > diffopt.flags.suppress_diff_headers = 1; > > Should this also (or only) check color.diff.frag? This code is not querying diff.color.frag, it is setting it. Without any way to override it. Having thought about it longer, and triggered by Peff's suggestion to decouple the "reverse" part from the actual color, I fixed this by - *not* setting .frag to magenta, - using the reverse method also to mark outer *hunk headers* (not only the outer -/+ markers). - actually calling git_diff_ui_config()... > I thought that color.diff.* was preferred over diff.color.*, though > that doesn't seem to be entirely true in all parts of the current > codebase. > > In testing this series it seems that setting color.diff > options to change the various colors read earlier in this > patch via diff_get_color_opt, as well as the 'frag' slot, > are ignored. Setting them via diff.color. does work. In my tests, it did not even work via diff.color.. But I think I fixed this (at least my local testing confirms this) by calling git_diff_ui_config(). > The later patch adding a man page documents branch-diff as > using `diff.color.*` and points to git-config(1), but the > config docs only list color.diff. In the current form (`git branch --diff`), I refrained from going into *so* much detail ;-) But the gist still holds, and now the code should support it, too. The current work in progress can be pulled as `branch-diff` from https://github.com/dscho/git, if I could ask you to test? Ciao, Dscho