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.9 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, 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 B0FCA1F8C8 for ; Sun, 19 Sep 2021 02:20:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233232AbhISCV2 (ORCPT ); Sat, 18 Sep 2021 22:21:28 -0400 Received: from cloud.peff.net ([104.130.231.41]:50540 "EHLO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232448AbhISCV1 (ORCPT ); Sat, 18 Sep 2021 22:21:27 -0400 Received: (qmail 17791 invoked by uid 109); 19 Sep 2021 02:20:03 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with ESMTP; Sun, 19 Sep 2021 02:20:03 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 3264 invoked by uid 111); 19 Sep 2021 02:20:02 -0000 Received: from coredump.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.2) by peff.net (qpsmtpd/0.94) with (TLS_AES_256_GCM_SHA384 encrypted) ESMTPS; Sat, 18 Sep 2021 22:20:02 -0400 Authentication-Results: peff.net; auth=none Date: Sat, 18 Sep 2021 22:20:02 -0400 From: Jeff King To: Eric Sunshine Cc: Taylor Blau , Andrzej Hunt via GitGitGadget , Git List , "brian m . carlson" , Andrzej Hunt Subject: Re: [PATCH] connect: also update offset for features without values Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Sat, Sep 18, 2021 at 09:02:37PM -0400, Eric Sunshine wrote: > On Sat, Sep 18, 2021 at 6:05 PM Jeff King wrote: > > Swapping out the "printf >expect" for a here-doc might make it a bit > > more readable. I used printf because of the tab handling, but: > > > > tab=$(printf "\t") > > cat >expect <<-EOF > > ref: ${dst}${tab}HEAD > > ${oid}${tab}HEAD > > EOF > > > > isn't too bad. > > Or just use q_to_tab(): > > q_to_tab >expect <<-EOF > ref: ${dst}QHEAD > ${oid}QHEAD > EOF > > However, the typical use-case for q_to_tab() is when we need a leading > or trailing TAB character. Ah, yeah, I forgot we had that. I _thought_ we had a variable ($HT or something) for this, but it looks like we only define and use it in a few scripts. I'm not sure using q_to_tab() is all that readable here, because it blends into the HEAD token. > When TAB is embedded within the line, we > often just use a literal TAB character; indeed, many tests in the > suite do exactly that, so that would be an even simpler option. Yeah, that'd probably be OK. I usually shy away from embedded tabs because they can cause confusion in editors. But we have them already, and this kind of expected output is not touched all that often. -Peff