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=-3.8 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 91A881F852 for ; Wed, 21 Dec 2022 21:14:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234774AbiLUVNa (ORCPT ); Wed, 21 Dec 2022 16:13:30 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230336AbiLUVN1 (ORCPT ); Wed, 21 Dec 2022 16:13:27 -0500 Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8927C21C for ; Wed, 21 Dec 2022 13:13:26 -0800 (PST) Received: by mail-pf1-f173.google.com with SMTP id 130so11545426pfu.8 for ; Wed, 21 Dec 2022 13:13:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=N2O5PbD/oIeAzvC8ibYobG6f5MQAS7m4+hKNXYe3r1g=; b=jAIp8lAEkA5njAqzr4EHnmCrOqAeL6OLdGiHtN7nVX54kN7sCFvdubAddKvIabiUyn +lmjJb0I0/B8Tvesg686FKirMjj7v6PUhg6NjqrQjIAp1y9rEragl4shyLJoiA3si3Mb fx9BhN1GXL4LrPpABbV8RqbXiXsRkqOVHGC6r2/9GYOybOj88F9C9EKWOXzM+3gugORP HWgDsmYEmFM/vLfSgLBEtMkHtdnfcitC1xmQhdG4rj33lyus3TyUvFyTWt0ECJUc7fCe wJAQCgtw2tV2DTH7ZoGgRYMmIgVGjGW000TdV85RFj/cqBWedgq46qHDrA8HswO+5kyl X/jA== X-Gm-Message-State: AFqh2kp/OfqeUpozRTlQnE9Xy1ZXDaqW02PxDgX59LKryricAF+kP0HA hZLLOWZ3FFC0Uh10dGvWMTI2/Nai4Xrxi6WZIy8= X-Google-Smtp-Source: AMrXdXvNOE8hvtNk2DNYXJKe/czZn5wQltmjPX25tq3YU787zETe++Yyw7zvPbJDkoqKaanoZ3VG8lp5PQUtGrEW4sU= X-Received: by 2002:a63:a12:0:b0:478:fbfd:5278 with SMTP id 18-20020a630a12000000b00478fbfd5278mr156524pgk.268.1671657205960; Wed, 21 Dec 2022 13:13:25 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Eric Sunshine Date: Wed, 21 Dec 2022 16:13:14 -0500 Message-ID: Subject: Re: [PATCH v4 2/2] attr: add flag `--revision` to work with revisions To: phillip.wood@dunelm.org.uk Cc: Karthik Nayak , git@vger.kernel.org, Toon Claes , Junio C Hamano Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org On Wed, Dec 21, 2022 at 3:58 PM Phillip Wood wrote: > On 21/12/2022 13:47, Karthik Nayak wrote: > > Since we use a tree-ish object, the user can pass "--revision > > HEAD:subdirectory" and all the attributes will be looked up as if > > subdirectory was the root directory of the repository. > > We should be clear in the documentation and option help that --revision > takes a tree-ish (i.e. --revision=). Maybe calling the option > --tree would be clearer. If that's the case, shouldn't this be called --source (or some variation thereof) for consistency[1] with git-restore? [1]: https://lore.kernel.org/git/CAPig+cT_xz3m-3kkL_Scf0opNXkikU94kSF46VO8KHkNMWbGzg@mail.gmail.com/ > > +attr_check_revision () { > > + path="$1" expect="$2" revision="$3" git_opts="$4" && > > Is that line valid posix shell? I know it works with local (which is not > in posix) but is it allowed for global variables? This is fine as-is; it's POSIX.