From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-2.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,RCVD_IN_SORBS_SPAM, RP_MATCHES_RCVD shortcircuit=no autolearn=no autolearn_force=no version=3.4.0 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id 5C0292047F for ; Mon, 7 Aug 2017 21:20:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752176AbdHGVT5 (ORCPT ); Mon, 7 Aug 2017 17:19:57 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:34883 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752094AbdHGVTy (ORCPT ); Mon, 7 Aug 2017 17:19:54 -0400 Received: by mail-pg0-f65.google.com with SMTP id l64so1397047pge.2 for ; Mon, 07 Aug 2017 14:19:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=um4Rl7gpMubJ+H2UBAU22FGtFVdktYtpR9fmhExfjwo=; b=PaC7wTHEn8tRjkj8Wxkt97mfidSXSZsiNsgzqBIeM5GAjaiL23kUUgxEnbQOJdOef8 ablHdlY36Dtok4zd5P5UjPsYmbwWghbjAlKTylb5D4MmZ78dr0lJGhaoXYqtygYLoZpz QU5i6F+DOF0qrNKyFF3qI0VYqQHWefbFzMGFc2QQlj4txmxDsocVWiq8GJP/FD2wPIRG 4nGLh373vnNd8Lt6VhoFgL5K4Wi4Lk1xPiwBltD31+QkYWa1jnHuHyQU0ltZ7iMlkYf3 YkptiZFIwJlDZJHCEOKWEbB+IilzBNjxnxqr2r0cKYbRcAaoZ0FicQvjjkbRkPwsCE06 bdxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=um4Rl7gpMubJ+H2UBAU22FGtFVdktYtpR9fmhExfjwo=; b=abGK8i6366e7LwEFZWqSNVfIpZIPGJV+30aXI8/IPxYnZYCBbTaHHxBfeHCqsVA1kQ jgPQbRRUUAkI/9+asEWXNSYVFxtEqDcrizkx8l8tl376X75N/ShtINRU37zHO2EdDI3P sK+gFY4NykuqGBsJdx4fw5dtYhmTcRkBteCZj7R2wURvjqUKIOr+A5cT7adKVcsSXH+a WBAgPxpqEmoLjMt/cN34VAePeLE68UMltY3CnpQc1Rb3p0XOvCVWW+Q6lsCXTyNXMJK8 Uh+y6qaL0AeV+0XOJafBjnDln3Zg+KRe+5aKa33YfY47NfcvaBq9R1hq+ew0gSuBpDJB dLmg== X-Gm-Message-State: AHYfb5hpY1S7DC9RNqYoTps1A1J4E8buUwtwMFWRpjBRTAIpnrrK298w I3TBdSoPoxRWEhqaaTQ= X-Received: by 10.98.62.28 with SMTP id l28mr2038739pfa.14.1502140793782; Mon, 07 Aug 2017 14:19:53 -0700 (PDT) Received: from localhost.localdomain ([2405:205:6016:3285:fd77:5453:49e2:f3b5]) by smtp.gmail.com with ESMTPSA id z127sm15141084pfb.64.2017.08.07.14.19.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 07 Aug 2017 14:19:53 -0700 (PDT) From: Prathamesh Chavan To: git@vger.kernel.org Cc: sbeller@google.com, christian.couder@gmail.com, Prathamesh Chavan Subject: [GSoC][PATCH 12/13] submodule foreach: document variable '$displaypath' Date: Tue, 8 Aug 2017 02:48:59 +0530 Message-Id: <20170807211900.15001-13-pc44800@gmail.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170807211900.15001-1-pc44800@gmail.com> References: <20170807211900.15001-1-pc44800@gmail.com> Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org It was observed that the variable '$displaypath' was accessible but undocumented. Hence, document it. Discussed-with: Ramsay Jones Signed-off-by: Stefan Beller Signed-off-by: Prathamesh Chavan --- Documentation/git-submodule.txt | 6 ++++-- t/t7407-submodule-foreach.sh | 22 +++++++++++----------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt index 8e7930ebc..0cca702cb 100644 --- a/Documentation/git-submodule.txt +++ b/Documentation/git-submodule.txt @@ -183,10 +183,12 @@ information too. foreach [--recursive] :: Evaluates an arbitrary shell command in each checked out submodule. - The command has access to the variables $name, $sm_path, $sha1 and - $toplevel: + The command has access to the variables $name, $sm_path, $displaypath, + $sha1 and $toplevel: $name is the name of the relevant submodule section in `.gitmodules`, $sm_path is the path of the submodule as recorded in the superproject, + $displaypath contains the relative path from the current working + directory to the submodules root directory, $sha1 is the commit as recorded in the superproject, and $toplevel is the absolute path to its superproject, such that $toplevel/$sm_path is the absolute path of the submodule. diff --git a/t/t7407-submodule-foreach.sh b/t/t7407-submodule-foreach.sh index 0663622a4..6ad57e061 100755 --- a/t/t7407-submodule-foreach.sh +++ b/t/t7407-submodule-foreach.sh @@ -82,16 +82,16 @@ test_expect_success 'test basic "submodule foreach" usage' ' cat >expect <../../actual + git submodule foreach "echo \$toplevel-\$name-\$sm_path-\$displaypath-\$sha1" >../../actual ) && test_i18ncmp expect actual ' @@ -206,25 +206,25 @@ submodulesha1=$(cd clone2/nested1/nested2/nested3/submodule && git rev-parse HEA cat >expect <../../actual + git submodule foreach --recursive "echo \$toplevel-\$name-\$sm_path-\$displaypath-\$sha1" >../../actual ) && test_i18ncmp expect actual ' -- 2.13.0