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: AS53758 23.128.96.0/24 X-Spam-Status: No, score=-4.0 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by dcvr.yhbt.net (Postfix) with ESMTP id 205501F852 for ; Thu, 13 Jan 2022 22:40:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238032AbiAMWj7 (ORCPT ); Thu, 13 Jan 2022 17:39:59 -0500 Received: from pb-smtp20.pobox.com ([173.228.157.52]:62140 "EHLO pb-smtp20.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235281AbiAMWj7 (ORCPT ); Thu, 13 Jan 2022 17:39:59 -0500 Received: from pb-smtp20.pobox.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 85CC116103A; Thu, 13 Jan 2022 17:39:58 -0500 (EST) (envelope-from junio@pobox.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=sasl; bh=ph97jcBAMbgf jdAxbXjkqYGRr0GcbM5tw28SZLImbrA=; b=jJ6nU2DhwsIzq193upcFGxnAZGv7 PGRNjtK/vL85Hizj+nXxu6W4HOayEo1/VRKMZIx8v8gRfnpzw82NmNSUJUL4QSQl MhS/T77JiHrp1bQzK63vL/sqElM2axLQI6JlkIQkk/7wabJ8rcRI9dTZHbJfaLMU LMtUFLTJ9ewxL+Q= Received: from pb-smtp20.sea.icgroup.com (unknown [127.0.0.1]) by pb-smtp20.pobox.com (Postfix) with ESMTP id 7F3CC161039; Thu, 13 Jan 2022 17:39:58 -0500 (EST) (envelope-from junio@pobox.com) Received: from pobox.com (unknown [104.133.2.91]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp20.pobox.com (Postfix) with ESMTPSA id E7164161037; Thu, 13 Jan 2022 17:39:55 -0500 (EST) (envelope-from junio@pobox.com) From: Junio C Hamano To: =?utf-8?B?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason Cc: git@vger.kernel.org, Jeff King , Bagas Sanjaya , Josh Steadmon Subject: Re: [PATCH v7 1/6] object-name tests: add tests for ambiguous object blind spots References: Date: Thu, 13 Jan 2022 14:39:54 -0800 In-Reply-To: (=?utf-8?B?IsOGdmFyIEFybmZqw7Zyw7A=?= Bjarmason"'s message of "Wed, 12 Jan 2022 13:39:20 +0100") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-Pobox-Relay-ID: BB3048FC-74C1-11EC-BF84-C85A9F429DF0-77302942!pb-smtp20.pobox.com Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org =C3=86var Arnfj=C3=B6r=C3=B0 Bjarmason writes: > +test_cmp_failed_rev_parse () { > + cat >expect && > + test_must_fail git -C "$1" rev-parse "$2" 2>actual.raw && > + sed "s/\($2\)[0-9a-f]*/\1.../" actual && > + test_cmp expect actual > +} That's dense, especially without a comment (or named variable) that hints readers what the arguments to this helper (and its standard input) ought to be. As long as messages from rev-parse on the error stream never has more than one abbreviated object name on a single line, the above should give us a copy of the message with expected object name abbreviated to $2; otherwise we might be missing a /g in the sed script.