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=-3.8 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, 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 B0D111F953 for ; Fri, 14 Jan 2022 12:10:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234815AbiANMJI (ORCPT ); Fri, 14 Jan 2022 07:09:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234740AbiANMJH (ORCPT ); Fri, 14 Jan 2022 07:09:07 -0500 Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D46F5C061574 for ; Fri, 14 Jan 2022 04:09:06 -0800 (PST) Received: by mail-ed1-x532.google.com with SMTP id 30so34302514edv.3 for ; Fri, 14 Jan 2022 04:09:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:references:user-agent:in-reply-to :message-id:mime-version:content-transfer-encoding; bh=2/njUzgCRJy2qyftH1v84qhPoq7USJ8hX91PUPdtXNU=; b=TsSBNAfhBM+uMk90cZOClxVwDKl5HVQRXD2n1QFvHkgEnvPmfNwIeIvfACG+p/ZImW XxnhlYhR8VfX5jUTKCvttv281klyrMm2wBhfRPZi8oORntZJhHF/GYXLurXxI/8UtnRL h7R8pDmpfitwYCrtwmz31P/SRuVUn0QUD4q3LYZ/WpFehrptFR4yiBwii4+ftGrFypNA 2UBjW/a5ZQWZNt1s2CwN7Dc5lydmx3twvgv9de7Edzg8FWXM6dnvEiureoVc/U/CP7gD dswqSEhcgYaOZV12bKdgHfcKx2O5r0fUw7v6voFIFZ5AiKT8GjndIgb4s9v0Ehf99wUv FZtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:references:user-agent :in-reply-to:message-id:mime-version:content-transfer-encoding; bh=2/njUzgCRJy2qyftH1v84qhPoq7USJ8hX91PUPdtXNU=; b=7zwiD++hAgcEImbFbRJ8FUlxUCDUAE2eBidj9MfOWUsoF4WwRGtPL8qn1L1oidERvk HgZozecN0EVOPbo5itkFpqKEUGXvxxNSlg4yUb7CejB7ur9/e0vRr4pVz3q9MJfQT+xz mIAbEQZDsYUvheAz01/4ZrJSOkEixHjmL+CIsRy4IAix4CacANhYoRwYNX88nn/ntqvR SZilKeJ4I3RmKGHGSLcVlmD7QG73oPs8sbKCU8a4vtF8VUekuJWzKGc+znqxcf5ge3w4 Bah2A6qpf+U1qsoQXzFvXypmGXvmQDv67+E9CsFw6GRbAuvqcsWW96EUcfvjNZet0CgD /OWw== X-Gm-Message-State: AOAM532gdxjlBtjBUx96D8lX1DIRIUXBjqGawGyQ9eahX4DbTbyOfeEm 7BhvUmmyqKFYutEjV2Ol0KersFG5+OQ= X-Google-Smtp-Source: ABdhPJzRmoB+cL5uU9lvS5v/l2OPkTka4oEENnCnmncTwF5G4l1aWkYuMlQUw6BsTdCoMc/zThyiNA== X-Received: by 2002:a17:906:7944:: with SMTP id l4mr7217918ejo.598.1642162145408; Fri, 14 Jan 2022 04:09:05 -0800 (PST) Received: from gmgdl (j120189.upc-j.chello.nl. [24.132.120.189]) by smtp.gmail.com with ESMTPSA id di18sm1777976ejc.56.2022.01.14.04.09.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jan 2022 04:09:04 -0800 (PST) Received: from avar by gmgdl with local (Exim 4.95) (envelope-from ) id 1n8LOC-0015Ps-4T; Fri, 14 Jan 2022 13:09:04 +0100 From: =?utf-8?B?w4Z2YXIgQXJuZmrDtnLDsA==?= Bjarmason To: Junio C Hamano 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 Date: Fri, 14 Jan 2022 13:07:53 +0100 References: User-agent: Debian GNU/Linux bookworm/sid; Emacs 27.1; mu4e 1.6.10 In-reply-to: Message-ID: <220114.861r1att7j.gmgdl@evledraar.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Thu, Jan 13 2022, Junio C Hamano wrote: > =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. I got rid of the named variables from v6 in response to a "shift" that shifted the wrong number, but perhaps I should have just removed the "shift"? > 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. In the v6 you rightly commented on the /g that was there previously not being needed :) So I dropped it, in this case we can rely on only getting the abbreviated output.