From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Status: No, score=-4.9 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by dcvr.yhbt.net (Postfix) with ESMTP id E21361F4D7 for ; Fri, 3 Jun 2022 18:52:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348059AbiFCSwK (ORCPT ); Fri, 3 Jun 2022 14:52:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348024AbiFCSwH (ORCPT ); Fri, 3 Jun 2022 14:52:07 -0400 Received: from nmsh5.e.nsc.no (nmsh5.e.nsc.no [148.123.160.199]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5BB2C2871D for ; Fri, 3 Jun 2022 11:52:03 -0700 (PDT) Received: from [192.168.1.110] (unknown [194.19.73.58]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: joak-pet) by nmsh5.e.nsc.no (smtp.online.no) with ESMTPSA id 9BB2252060; Fri, 3 Jun 2022 20:52:01 +0200 (CEST) Message-ID: <9fa34f22-3404-7bf8-6985-642c80634bf8@online.no> Date: Fri, 3 Jun 2022 20:51:58 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH v3] git-prompt: make colourization consistent Content-Language: en-GB From: Joakim Petersen To: Junio C Hamano Cc: git@vger.kernel.org, =?UTF-8?B?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= , Justin Donnelly References: <20220602145935.10512-1-joak-pet@online.no> <20220603142521.42863-1-joak-pet@online.no> <7d391d82-b15e-4a31-5207-c4037fec0bf9@online.no> In-Reply-To: <7d391d82-b15e-4a31-5207-c4037fec0bf9@online.no> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Source-IP: 194.19.73.58 X-Scanned-By: MIMEDefang 2.84 on 10.123.160.199 Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On 03/06/2022 19:23, Joakim Petersen wrote: > That does seem like a much better idea for maintainability, I can > change the patch to do this instead. I have one question, though: the > sequence $c$b (bare state and branch name) is a special case, where > they're intended to have the same colour, should I wrap both in colour > set, colour clear, or only clear after $b? The former requires rewriting > the tests or changing $gitstring to not include $c when $c is empty, > while the latter keeps the tests unchanged, but may pose a problem if > "BARE:" should at any point not appear immediately before the branch > name. Sorry, the former (colourizing and clearing $c and $b individually) requires rewriting tests no matter what.