From patchwork Sun Apr 5 20:16:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Robert X-Patchwork-Id: 11474865 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3F1041805 for ; Sun, 5 Apr 2020 20:16:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1E1822072A for ; Sun, 5 Apr 2020 20:16:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Lhb44B5e" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727703AbgDEUQx (ORCPT ); Sun, 5 Apr 2020 16:16:53 -0400 Received: from mail-wm1-f45.google.com ([209.85.128.45]:39347 "EHLO mail-wm1-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727018AbgDEUQw (ORCPT ); Sun, 5 Apr 2020 16:16:52 -0400 Received: by mail-wm1-f45.google.com with SMTP id y20so1724083wma.4 for ; Sun, 05 Apr 2020 13:16:51 -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 :mime-version:content-transfer-encoding; bh=GczwqmMhMlAsF6vOl+pzB+tlGjL9CRkkYe2i+lVhiBo=; b=Lhb44B5ensr6Mt9U5U5S+BSYgHKzc7MCR2tL+m4cqS+1ubKCYwYw2aZPm9c4o3GKyN GHQ5JJkS+lWtr3252D71rq3fkn4+X7kFQCCUeDm0GlZhoo081KWg24Ag6oSbQh92GCJY cWBxcL7Td5aiCoKkIw+DLfwxs00H53IrCUj+I9EFBQFf455aj/PvfTIzFQwkbUj+TQ/f if9ReNHx5DbW997+tAMTgj85Lq9e+xsop8zkn/7qTyqBy/f52nULphi+G4LHAZCbu35E 6ac5DFkQPxqVi2cmBU/N8wcG1iycUUlLoylpr82M/LPMj6HiCdUjOCNM2h9LEUhaPhTn ytdg== 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:mime-version:content-transfer-encoding; bh=GczwqmMhMlAsF6vOl+pzB+tlGjL9CRkkYe2i+lVhiBo=; b=uTbP4ZaEva65VyKMcZ03SLFVtOnatbWSudTCZtv3fE0O1c7p5RxiqxQdD4kM90xEaH GpoBiXpumTyBsFA2kAimx29D6mYxpu2pBbqsperLV5GDPszasZpHYcP9TtdKZSktSSbS WzKJ/E4buJ5iA2hwRrKvLVK9sSzcv8+U1dh+/fK0YP9dfIW+ur6hNOc1ZtwLC974KZt7 FouLFPzKkuV80Bnix3t11fW2KXLq1CO86dUbow6xtEHHcb5yA+5mgEFRsIOZM5kQZdT1 ZOu5TQ2rtysgkJs0Pcj4G/FogrOQeoRsW/uPpibNHvEDAFHeQe3RrOzafIzv2yxZDNUE VZrQ== X-Gm-Message-State: AGi0PuaZd62zmX9m2I9g5M1FHnAv84fnt5pyb2Jv4mNY88pPSplmq6dO ypteYPmweANQcdtRjpvQqLjtJIeYGmy0xg== X-Google-Smtp-Source: APiQypKtp5RHjGzPXGRKVXFUZUikhGYLrd1Trkaavjn0EM7iPQFkWvJhwDD4gB9ngcCJwRiUUtBH2w== X-Received: by 2002:a05:600c:2f88:: with SMTP id t8mr10341962wmn.46.1586117810479; Sun, 05 Apr 2020 13:16:50 -0700 (PDT) Received: from localhost.localdomain (87-231-246-247.rev.numericable.fr. [87.231.246.247]) by smtp.gmail.com with ESMTPSA id d7sm22468921wrr.77.2020.04.05.13.16.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Apr 2020 13:16:50 -0700 (PDT) From: Damien Robert X-Google-Original-From: Damien Robert To: git@vger.kernel.org, Philippe Blain Cc: Damien Robert Subject: [PATCH v5 1/5] doc: list all commands affected by submodule.recurse Date: Sun, 5 Apr 2020 22:16:29 +0200 Message-Id: <20200405201633.704987-2-damien.olivier.robert+git@gmail.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200405201633.704987-1-damien.olivier.robert+git@gmail.com> References: <20200405201633.704987-1-damien.olivier.robert+git@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Note that `ls-files` is not affected, even though it has a `--recurse-submodules` option, so list it as an exception too. Signed-off-by: Damien Robert --- Documentation/config/submodule.txt | 5 +++-- Documentation/gitsubmodules.txt | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Documentation/config/submodule.txt b/Documentation/config/submodule.txt index b33177151c..5962f41ead 100644 --- a/Documentation/config/submodule.txt +++ b/Documentation/config/submodule.txt @@ -59,8 +59,9 @@ submodule.active:: submodule.recurse:: Specifies if commands recurse into submodules by default. This - applies to all commands that have a `--recurse-submodules` option, - except `clone`. + applies to all commands that have a `--recurse-submodules` option + (`checkout`, `fetch`, `grep`, `pull`, `push`, `read-tree`, `reset`, + `restore` and `switch`) except `clone` and `ls-files`. Defaults to false. submodule.fetchJobs:: diff --git a/Documentation/gitsubmodules.txt b/Documentation/gitsubmodules.txt index c476f891b5..f9f4e65c9e 100644 --- a/Documentation/gitsubmodules.txt +++ b/Documentation/gitsubmodules.txt @@ -271,7 +271,8 @@ will not be checked out by default; You can instruct 'clone' to recurse into submodules. The 'init' and 'update' subcommands of 'git submodule' will maintain submodules checked out and at an appropriate revision in your working tree. Alternatively you can set 'submodule.recurse' to have -'checkout' recursing into submodules. +'checkout' recursing into submodules (note that 'submodule.recurse' also +affects other git commands, see linkgit:git-config[1] for a complete list). SEE ALSO From patchwork Sun Apr 5 20:16:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Robert X-Patchwork-Id: 11474869 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7D9311871 for ; Sun, 5 Apr 2020 20:16:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5C9D020659 for ; Sun, 5 Apr 2020 20:16:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="iI1FMQnB" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727779AbgDEUQz (ORCPT ); Sun, 5 Apr 2020 16:16:55 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:51025 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727444AbgDEUQy (ORCPT ); Sun, 5 Apr 2020 16:16:54 -0400 Received: by mail-wm1-f67.google.com with SMTP id x25so1567560wmc.0 for ; Sun, 05 Apr 2020 13:16:52 -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 :mime-version:content-transfer-encoding; bh=mvoM5/GcQipnc8y5cLDIFcdDrYFJyt/pYp42NjEvE2c=; b=iI1FMQnBqguK3lap9ryj49MMmMkgpINJwQSbpq0veqJfrloq4O3A0EUNmDguQO/0Ws SIsPcdowhPSMVwEyyG7IXOEGaXBtpzjiN7siePXtiziv2trXKGWrgyt46Uluapdb4H4F rwca8jTaEMIt2Nxj7PGSjX8uudpxH4xFahsDajFpJL+s9IVzV0IBFQTyNaMclBWfX32q q7X01AFhjVcy9086xUx8Ttr2tZAsgpfMqFGhidRFjtamdqVUnmjtTmDorLnILOBE8KM6 ofL+BjG/0tPupgQDcF+HCcQoiPDB/cuo5PTUCKpNdfgPFBRUrWfgDIQC5aQHL/DlPuiW pJ7w== 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:mime-version:content-transfer-encoding; bh=mvoM5/GcQipnc8y5cLDIFcdDrYFJyt/pYp42NjEvE2c=; b=U59DOvVQJZ+E6FVQnbNN7WVThtpw/3e9n51F1MWq/St2BtQq7LbJOUkP1PZbDclmni iiT3yNNOPyoQ0knbgBIODo8W6KXz0VK9LAuGpoQjBFBZJfjLe4kATQabIi05k5UTvtRK 0RauksERqpeCz1aeB7NDguuKNVfp3vz1uvl5zAQGtMcAmwml3310SmiGP2FukEaVs7fa 3iFPk2ppCezY5y1A9FID2O2bvYfuHXTBbSytj0ZsUejYhygoQCKqf3ntB1lYYPo03jD0 h5xEeUchieIBDFRKDbSJN9TacCKHxxa8WzfBWzKlloM3t+EUbvQdzotOzbjKnVBI6fEX IPXw== X-Gm-Message-State: AGi0PuY7bZQ+jrVato4xN33YbBdNWTn0Lj8HpgO2Z4rHaQcfWN35dfD4 vxL/2w3BKm7Ka26khMtZ4EWGAc4wACrzSA== X-Google-Smtp-Source: APiQypId/eswA9S1vR7F2X++0YYcJW0rgIXZm2V93I7n+AQiAS+7SzQ7Q0iIukHoIAiX6d9u63vURw== X-Received: by 2002:a7b:cb86:: with SMTP id m6mr1717640wmi.64.1586117811284; Sun, 05 Apr 2020 13:16:51 -0700 (PDT) Received: from localhost.localdomain (87-231-246-247.rev.numericable.fr. [87.231.246.247]) by smtp.gmail.com with ESMTPSA id d7sm22468921wrr.77.2020.04.05.13.16.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Apr 2020 13:16:50 -0700 (PDT) From: Damien Robert X-Google-Original-From: Damien Robert To: git@vger.kernel.org, Philippe Blain Cc: Damien Robert Subject: [PATCH v5 2/5] doc: document --recurse-submodules for reset and restore Date: Sun, 5 Apr 2020 22:16:30 +0200 Message-Id: <20200405201633.704987-3-damien.olivier.robert+git@gmail.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200405201633.704987-1-damien.olivier.robert+git@gmail.com> References: <20200405201633.704987-1-damien.olivier.robert+git@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Also unify the formulation about --no-recurse-submodules for checkout and switch, which we reuse for restore. And correct the formulation about submodules' HEAD in read-tree, which we reuse in reset. Signed-off-by: Damien Robert --- Documentation/git-checkout.txt | 2 +- Documentation/git-read-tree.txt | 2 +- Documentation/git-reset.txt | 6 ++++++ Documentation/git-restore.txt | 11 +++++++++++ Documentation/git-switch.txt | 2 +- 5 files changed, 20 insertions(+), 3 deletions(-) diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt index c8fb995fa7..140bd3eabb 100644 --- a/Documentation/git-checkout.txt +++ b/Documentation/git-checkout.txt @@ -296,7 +296,7 @@ Note that this option uses the no overlay mode by default (see also submodules according to the commit recorded in the superproject. If local modifications in a submodule would be overwritten the checkout will fail unless `-f` is used. If nothing (or `--no-recurse-submodules`) - is used, the work trees of submodules will not be updated. + is used, submodules working trees will not be updated. Just like linkgit:git-submodule[1], this will detach `HEAD` of the submodule. diff --git a/Documentation/git-read-tree.txt b/Documentation/git-read-tree.txt index da33f84f33..501f2ec375 100644 --- a/Documentation/git-read-tree.txt +++ b/Documentation/git-read-tree.txt @@ -118,7 +118,7 @@ OPTIONS --[no-]recurse-submodules:: Using --recurse-submodules will update the content of all initialized submodules according to the commit recorded in the superproject by - calling read-tree recursively, also setting the submodules HEAD to be + calling read-tree recursively, also setting the submodules' HEAD to be detached at that commit. --no-sparse-checkout:: diff --git a/Documentation/git-reset.txt b/Documentation/git-reset.txt index 932080c55d..252e2d4e47 100644 --- a/Documentation/git-reset.txt +++ b/Documentation/git-reset.txt @@ -87,6 +87,12 @@ but carries forward unmerged index entries. different between `` and `HEAD`. If a file that is different between `` and `HEAD` has local changes, reset is aborted. + +--[no-]recurse-submodules:: + When the working tree is updated, using --recurse-submodules will + also recursively reset the working tree of all active submodules + according to the commit recorded in the superproject, also setting + the submodules' HEAD to be detached at that commit. -- See "Reset, restore and revert" in linkgit:git[1] for the differences diff --git a/Documentation/git-restore.txt b/Documentation/git-restore.txt index 5bf60d4943..8e3b339802 100644 --- a/Documentation/git-restore.txt +++ b/Documentation/git-restore.txt @@ -107,6 +107,17 @@ in linkgit:git-checkout[1] for details. patterns and unconditionally restores any files in ``. +--recurse-submodules:: +--no-recurse-submodules:: + If `` names an active submodule and the restore location + includes the working tree, the submodule will only be updated if + this option is given, in which case its working tree will be + restored to the commit recorded in the superproject, and any local + modifications overwritten. If nothing (or + `--no-recurse-submodules`) is used, submodules working trees will + not be updated. Just like linkgit:git-checkout[1], this will detach + `HEAD` of the submodule. + --overlay:: --no-overlay:: In overlay mode, the command never removes files when diff --git a/Documentation/git-switch.txt b/Documentation/git-switch.txt index 197900363b..79dbc9624d 100644 --- a/Documentation/git-switch.txt +++ b/Documentation/git-switch.txt @@ -183,7 +183,7 @@ name, the guessing is aborted. You can explicitly give a name with Using `--recurse-submodules` will update the content of all initialized submodules according to the commit recorded in the superproject. If nothing (or `--no-recurse-submodules`) is - used, the work trees of submodules will not be updated. Just + used, submodules working trees will not be updated. Just like linkgit:git-submodule[1], this will detach `HEAD` of the submodules. From patchwork Sun Apr 5 20:16:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Robert X-Patchwork-Id: 11474867 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5280692A for ; Sun, 5 Apr 2020 20:16:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 314C72072A for ; Sun, 5 Apr 2020 20:16:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="IStKyodh" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727798AbgDEUQz (ORCPT ); Sun, 5 Apr 2020 16:16:55 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:52069 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727077AbgDEUQy (ORCPT ); Sun, 5 Apr 2020 16:16:54 -0400 Received: by mail-wm1-f68.google.com with SMTP id z7so12591085wmk.1 for ; Sun, 05 Apr 2020 13:16:52 -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 :mime-version:content-transfer-encoding; bh=bYBe3OpuZ9n0K8eByYmAM/5gIOocBDpwe2ST+mZ+Pu4=; b=IStKyodhOVUdmNgNsRozznBvWPtgESf0fD3M8vCwJ936kYHmkxOzlWGjBUy+mEVEBh cUQuGdU+rnjkhmox0cS4LpADpdq7F0/MdcuzxaaQ7tETGVc9yctvKEzsvCoqfnSBPADq Qub5Ee9DsoP9PKXfNi9mTSt5XTn6pUSL35f5tWnkimYz8Wzo2V6T9TWqp24Bmbz2PdRh GoGrfTaH9ixHgNe5JauKwj2TCBJPENHXMwx7NdPdpoYT+L867f+gIj7a31DFDIi/HOgP 6RF0Rro3j+/RCtXwjjKuZsbl3I+WAaH0lHVPkH4l3CPldSr4pcqQ/ozmYGLCld415ID9 v9DQ== 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:mime-version:content-transfer-encoding; bh=bYBe3OpuZ9n0K8eByYmAM/5gIOocBDpwe2ST+mZ+Pu4=; b=mklREFP5KLolqmrpeZFce0ykW9bK0dj36ojLQggW6HL10Aa+qkmaWkVdMkIMwwIQAv NvrHdEGl2mRlkioCSsRlZlpoOW0iRD72UQsUgcWDvHcmzHlBoGa8ENfxTVOekHpqQxnX ukoDNVx4Tzo9x9/GX/+jXAZB5ait5h8olcOtcGiEgh2dTBg/hqH7X7wdPJzXnYXjDJbm SOWdwnYIg4B5/6lKBOz5BxXfYzkVmxpLEma5vONsxT0ehkLsHOG2t9kkVbMgjhUg07B/ bvzmW6nYO8bimyqGs3Hu6jAsRNQb0ZQ6bbcdeE9jvaaID5w5jYnivwTJ0TiK43aa130K su3w== X-Gm-Message-State: AGi0PuYKJ4/or7XcefhYxpsucWQbrHI5TJWj0O9z5HQVSsL0+PXknvYY E/2g0VHPCsHUELC0mRbVmnJgG2oYnS5KIg== X-Google-Smtp-Source: APiQypKNOyxhapjxaMvAcprRMLauaczyubxuxPy/eEjEOWDPMAXX2GRsn2Yd5QYCishe+g5e9airAg== X-Received: by 2002:a1c:6189:: with SMTP id v131mr19399341wmb.69.1586117812125; Sun, 05 Apr 2020 13:16:52 -0700 (PDT) Received: from localhost.localdomain (87-231-246-247.rev.numericable.fr. [87.231.246.247]) by smtp.gmail.com with ESMTPSA id d7sm22468921wrr.77.2020.04.05.13.16.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Apr 2020 13:16:51 -0700 (PDT) From: Damien Robert X-Google-Original-From: Damien Robert To: git@vger.kernel.org, Philippe Blain Cc: Damien Robert Subject: [PATCH v5 3/5] doc: explain how to deactivate submodule.recurse completely Date: Sun, 5 Apr 2020 22:16:31 +0200 Message-Id: <20200405201633.704987-4-damien.olivier.robert+git@gmail.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200405201633.704987-1-damien.olivier.robert+git@gmail.com> References: <20200405201633.704987-1-damien.olivier.robert+git@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Signed-off-by: Damien Robert --- Documentation/config/submodule.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Documentation/config/submodule.txt b/Documentation/config/submodule.txt index 5962f41ead..d7a63c8c12 100644 --- a/Documentation/config/submodule.txt +++ b/Documentation/config/submodule.txt @@ -63,6 +63,13 @@ submodule.recurse:: (`checkout`, `fetch`, `grep`, `pull`, `push`, `read-tree`, `reset`, `restore` and `switch`) except `clone` and `ls-files`. Defaults to false. + When set to true, it can be deactivated via the + `--no-recurse-submodules` option. Note that some Git commands + lacking this option may call some of the above commands affected by + `submodule.recurse`; for instance `git remote update` will call + `git fetch` but does not have a `--no-recurse-submodules` option. + For these commands a workaround is to temporarily change the + configuration value by using `git -c submodule.recurse=0`. submodule.fetchJobs:: Specifies how many submodules are fetched/cloned at the same time. From patchwork Sun Apr 5 20:16:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Robert X-Patchwork-Id: 11474875 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A6C251805 for ; Sun, 5 Apr 2020 20:16:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 867EE2072F for ; Sun, 5 Apr 2020 20:16:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="EmcTB+5u" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727815AbgDEUQ5 (ORCPT ); Sun, 5 Apr 2020 16:16:57 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:34512 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727018AbgDEUQ4 (ORCPT ); Sun, 5 Apr 2020 16:16:56 -0400 Received: by mail-wm1-f68.google.com with SMTP id c195so6383188wme.1 for ; Sun, 05 Apr 2020 13:16: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 :mime-version:content-transfer-encoding; bh=/JZ4W1b0My3gCAzn+gTfP2mQ65yXawb6uxIAPqNeVKM=; b=EmcTB+5u2GkURL7CWIzVypMaYXRwf42E/XEYnNWmiXD8TPbGTjMViZpaTDzVU/FJHi l4VOHISPw7EfpgQsmqkMOAS7yDTc3HqCbarFpS6dBeSArMKXFb4cW0YQIRoUhJWryjEM ZJlcPGNS9PRj9kJHK75v1BM+F5A34ynX4uZv2lR6nrKVin+XrGq9ImGmbpZYiLKDOICg Ej0TtoXewOcQiCsucbvferfV7QfcMNjhbvsP04SfWFhPaZL2O0YZWVaf3R0qM1NILakT mMxt0W+JTIPSJfEPWUyEQwtjhe4bRdGGZB4FrvjPmL0afjRiOHqrYhzzGJ/TQpqkqSD2 q0FA== 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:mime-version:content-transfer-encoding; bh=/JZ4W1b0My3gCAzn+gTfP2mQ65yXawb6uxIAPqNeVKM=; b=jtgHJ+pv5buxmBNMdHNBsVHzFLh8kZXgClAt0aRf0UoAOXci3u8gJM5fXtA71Vr8Ir OZC1GhaSrrgM/SB6FUT7j7WRox01qgQ+rezEIpcvJbvcl5DK053m9EH1UlbOkkgDeVxL dyC6Opq+LAjW547UACNTdBa2ls6xvDXjTPS/w7JMW5qwE1e6tEVSq1t48ahgr01KB6eK jOaC0Hyr50MibL+Y629EEhv5CmsxTR3uz+rOMUrspgYDEBpzkCrjvZDwCtKOMgZSPPzY GCORZvkSeXqvE6c7Py+IsgQYo8GHI8USJTVPFUadX7EihkN7EjPDM09HlGIUJnwl20wB 88Cw== X-Gm-Message-State: AGi0PuaYsYWpzO25fNEOUpXQeWQrsA2tfH8/1INXrStyCKLnKQ6qeGa4 SYeH98hxDoVkm7HDi0WzMEuMZghXLBTLJw== X-Google-Smtp-Source: APiQypK0q/KxCKB8InNo30hKu1SYS3fANYiNJi4qTrILgU1A3vXWuB9Pf7Oo+bvmpR6c4abEWoqhbw== X-Received: by 2002:a05:600c:2c06:: with SMTP id q6mr19501997wmg.42.1586117812975; Sun, 05 Apr 2020 13:16:52 -0700 (PDT) Received: from localhost.localdomain (87-231-246-247.rev.numericable.fr. [87.231.246.247]) by smtp.gmail.com with ESMTPSA id d7sm22468921wrr.77.2020.04.05.13.16.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Apr 2020 13:16:52 -0700 (PDT) From: Damien Robert X-Google-Original-From: Damien Robert To: git@vger.kernel.org, Philippe Blain Cc: Damien Robert Subject: [PATCH v5 4/5] doc: be more precise on (fetch|push).recurseSubmodules Date: Sun, 5 Apr 2020 22:16:32 +0200 Message-Id: <20200405201633.704987-5-damien.olivier.robert+git@gmail.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200405201633.704987-1-damien.olivier.robert+git@gmail.com> References: <20200405201633.704987-1-damien.olivier.robert+git@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org The default value also depends on the value of submodule.recurse. Use this opportunity to correct some grammar mistakes in Documentation/config/fetch.txt signaled by Robert P. J. Day. Also mention `fetch.recurseSubmodules` in fetch-options.txt. In git-push.txt, `push.recurseSubmodules` is implicitly mentioned (by explaining how to disable it), so no need to add it there. Lastly add a link to `git-fetch` in `git-pull.txt` to explain the meaning of `--recurse-submodules` there. Signed-off-by: Damien Robert --- Documentation/config/fetch.txt | 13 ++++++++----- Documentation/config/push.txt | 2 ++ Documentation/fetch-options.txt | 3 ++- Documentation/git-pull.txt | 3 +-- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/Documentation/config/fetch.txt b/Documentation/config/fetch.txt index f11940280f..4114af4b3b 100644 --- a/Documentation/config/fetch.txt +++ b/Documentation/config/fetch.txt @@ -1,11 +1,14 @@ fetch.recurseSubmodules:: - This option can be either set to a boolean value or to 'on-demand'. + This option controls whether `git fetch` (and the underlying fetch + in `git pull`) will recursively fetch into populated submodules. + This option can be set either to a boolean value or to 'on-demand'. Setting it to a boolean changes the behavior of fetch and pull to - unconditionally recurse into submodules when set to true or to not - recurse at all when set to false. When set to 'on-demand' (the default - value), fetch and pull will only recurse into a populated submodule - when its superproject retrieves a commit that updates the submodule's + recurse unconditionally into submodules when set to true or to not + recurse at all when set to false. When set to on-demand, fetch and + pull will only recurse into a populated submodule when its + superproject retrieves a commit that updates the submodule's reference. + Defaults to 'on-demand', or to the value of 'submodule.recurse' if set. fetch.fsckObjects:: If it is set to true, git-fetch-pack will check all fetched diff --git a/Documentation/config/push.txt b/Documentation/config/push.txt index 0a7aa322a9..f5e5b38c68 100644 --- a/Documentation/config/push.txt +++ b/Documentation/config/push.txt @@ -112,3 +112,5 @@ push.recurseSubmodules:: is 'no' then default behavior of ignoring submodules when pushing is retained. You may override this configuration at time of push by specifying '--recurse-submodules=check|on-demand|no'. + If not set, 'no' is used by default, unless 'submodule.recurse' is + set (in which case a 'true' value means 'on-demand'). diff --git a/Documentation/fetch-options.txt b/Documentation/fetch-options.txt index 00d03ec8c3..833f935cd0 100644 --- a/Documentation/fetch-options.txt +++ b/Documentation/fetch-options.txt @@ -163,7 +163,8 @@ ifndef::git-pull[] value. Use 'on-demand' to only recurse into a populated submodule when the superproject retrieves a commit that updates the submodule's reference to a commit that isn't already in the local submodule - clone. + clone. By default, 'on-demand' is used, unless + `fetch.recurseSubmodules` is set (see linkgit:git-config[1]). endif::git-pull[] -j:: diff --git a/Documentation/git-pull.txt b/Documentation/git-pull.txt index dfb901f8b8..47bc4a7061 100644 --- a/Documentation/git-pull.txt +++ b/Documentation/git-pull.txt @@ -86,8 +86,7 @@ OPTIONS --[no-]recurse-submodules[=yes|on-demand|no]:: This option controls if new commits of all populated submodules should - be fetched and updated, too (see linkgit:git-config[1] and - linkgit:gitmodules[5]). + be fetched and updated, too (see linkgit:git-fetch[1], linkgit:git-config[1] and linkgit:gitmodules[5]). + If the checkout is done via rebase, local submodule commits are rebased as well. + From patchwork Sun Apr 5 20:16:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damien Robert X-Patchwork-Id: 11474873 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 163F592C for ; Sun, 5 Apr 2020 20:16:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DF7E420659 for ; Sun, 5 Apr 2020 20:16:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="lo4Ov76F" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727837AbgDEUQ6 (ORCPT ); Sun, 5 Apr 2020 16:16:58 -0400 Received: from mail-wm1-f68.google.com ([209.85.128.68]:55954 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727763AbgDEUQ4 (ORCPT ); Sun, 5 Apr 2020 16:16:56 -0400 Received: by mail-wm1-f68.google.com with SMTP id r16so12625854wmg.5 for ; Sun, 05 Apr 2020 13:16: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 :mime-version:content-transfer-encoding; bh=E+Q6JaNMMD7zUzOz2lG8423EFFmQSh4IWdLGxHP7AhE=; b=lo4Ov76FJqWwPFsPjLy9+VoRXtNlHnTzkyoIfL1X8w40ZSvlVLNTSq+23gNNmdxeqA 0wkr90CMEywLhe6sNEweC74pUge4KfwPEkTdsp7oLsF/LGpKx3aVRcfuOezVMnyBlIdn Mdj8LpeunyjQsvZbJeRtOLx+Rz6yacNJ+eoDm9ZYqquj3eavxFkzQvm0ETWSE/us+Ok/ fOg/t9WtLchr2M+Nz/z1IUJp1Vca22BzjMbWCuAdBKO+DWjSMF8vvkLLEMQSYzG/inOA VDmvpcHAJs7zsOeOGrsqokdPA9r9pwPOZREWXC75fzdcAeKP4ctCA/zziWEm5Z7hoxGZ we9g== 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:mime-version:content-transfer-encoding; bh=E+Q6JaNMMD7zUzOz2lG8423EFFmQSh4IWdLGxHP7AhE=; b=smgdStXiTD7ZGzO3kmdnXWDbkYVuN5ZXma632HbHciAKbe/il03KvHSr3UoOlsYyUf ZEJn4tpSe+4BcjwHGqNWhUcaUIcSJEcS+2Ug+QhNF9UdF0VAfA1GqLW0v0jpGyU6Nci0 rL+vB2CmO/Qf6dC61qo81n0q1QE0EeZwUUzXZIzV1cZLBghaLDvrrHlQIwO0oU/NY7+q rjGaUpi8hECYdB4GZI9oyTWCzF4VcpA/0jrSpQcFir93RWZ7VRsKO7+RbkCWcDABo2zl SBuz7f9jyQowLC536PJNFPyIgL3WqbfLiHVocsNBXI0PNWGKD/KzmYDLa9MHuZdwFC91 bnLg== X-Gm-Message-State: AGi0PuYjUHAnDP7LjRUM7AcE9YxYaigiq7UtnZdzES0IWyjrRSpKURFf FL7ajkgNJ6u5JJocZ/Re75A7icomtuShFQ== X-Google-Smtp-Source: APiQypKIzwOAbJ08Yoqc3zuwDuQRteRsV56aLFp9WY8rTCTNwIF2UD80vFkcKao1vc3guLSSSExpUA== X-Received: by 2002:a1c:3885:: with SMTP id f127mr18900766wma.134.1586117813754; Sun, 05 Apr 2020 13:16:53 -0700 (PDT) Received: from localhost.localdomain (87-231-246-247.rev.numericable.fr. [87.231.246.247]) by smtp.gmail.com with ESMTPSA id d7sm22468921wrr.77.2020.04.05.13.16.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Apr 2020 13:16:53 -0700 (PDT) From: Damien Robert X-Google-Original-From: Damien Robert To: git@vger.kernel.org, Philippe Blain Cc: Damien Robert Subject: [PATCH v5 5/5] doc: --recurse-submodules mostly applies to active submodules Date: Sun, 5 Apr 2020 22:16:33 +0200 Message-Id: <20200405201633.704987-6-damien.olivier.robert+git@gmail.com> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200405201633.704987-1-damien.olivier.robert+git@gmail.com> References: <20200405201633.704987-1-damien.olivier.robert+git@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org The documentation refers to "initialized" or "populated" submodules, to explain which submodules are affected by '--recurse-submodules', but the real terminology here is 'active' submodules. Update the documentation accordingly. Some terminology: - Active is defined in gitsubmodules(7), it only involves the configuration variables 'submodule.active', 'submodule..active' and 'submodule..url'. The function submodule.c::is_submodule_active checks that a submodule is active. - Populated means that the submodule's working tree is present (and the gitfile correctly points to the submodule repository), i.e. either the superproject was cloned with ` --recurse-submodules`, or the user ran `git submodule update --init`, or `git submodule init []` and `git submodule update []` separately which populated the submodule working tree. This does not involve the 3 configuration variables above. - Initialized (at least in the context of the man pages involved in this patch) means both "populated" and "active" as defined above, i.e. what `git submodule update --init` does. The --recurse-submodules option mostly affects active submodules. An exception is `git fetch` where the option affects populated submodules. As a consequence, in `git pull --recurse-submodules` the fetch affects populated submodules, but the resulting working tree update only affects active submodules. In the documentation of `git-pull`, let's distinguish between the fetching part which affects populated submodules, and the updating of worktrees, which only affects active submodules. Signed-off-by: Damien Robert Helped-by: Philippe Blain --- Documentation/git-checkout.txt | 2 +- Documentation/git-grep.txt | 2 +- Documentation/git-ls-files.txt | 2 +- Documentation/git-pull.txt | 6 ++++-- Documentation/git-read-tree.txt | 2 +- Documentation/git-switch.txt | 2 +- 6 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Documentation/git-checkout.txt b/Documentation/git-checkout.txt index 140bd3eabb..5b697eee1b 100644 --- a/Documentation/git-checkout.txt +++ b/Documentation/git-checkout.txt @@ -292,7 +292,7 @@ Note that this option uses the no overlay mode by default (see also --recurse-submodules:: --no-recurse-submodules:: - Using `--recurse-submodules` will update the content of all initialized + Using `--recurse-submodules` will update the content of all active submodules according to the commit recorded in the superproject. If local modifications in a submodule would be overwritten the checkout will fail unless `-f` is used. If nothing (or `--no-recurse-submodules`) diff --git a/Documentation/git-grep.txt b/Documentation/git-grep.txt index ddb6acc025..cdf8e26b47 100644 --- a/Documentation/git-grep.txt +++ b/Documentation/git-grep.txt @@ -93,7 +93,7 @@ OPTIONS with `--no-index`. --recurse-submodules:: - Recursively search in each submodule that has been initialized and + Recursively search in each submodule that is active and checked out in the repository. When used in combination with the option the prefix of all submodule output will be the name of the parent project's object. This option has no effect diff --git a/Documentation/git-ls-files.txt b/Documentation/git-ls-files.txt index 8461c0e83e..3cb2ebb438 100644 --- a/Documentation/git-ls-files.txt +++ b/Documentation/git-ls-files.txt @@ -148,7 +148,7 @@ a space) at the start of each line: top directory. --recurse-submodules:: - Recursively calls ls-files on each submodule in the repository. + Recursively calls ls-files on each active submodule in the repository. Currently there is only support for the --cached mode. --abbrev[=]:: diff --git a/Documentation/git-pull.txt b/Documentation/git-pull.txt index 47bc4a7061..b336df00c7 100644 --- a/Documentation/git-pull.txt +++ b/Documentation/git-pull.txt @@ -85,8 +85,10 @@ OPTIONS Pass --verbose to git-fetch and git-merge. --[no-]recurse-submodules[=yes|on-demand|no]:: - This option controls if new commits of all populated submodules should - be fetched and updated, too (see linkgit:git-fetch[1], linkgit:git-config[1] and linkgit:gitmodules[5]). + This option controls if new commits of populated submodules should + be fetched, and if the working trees of active submodules should be + updated, too (see linkgit:git-fetch[1], linkgit:git-config[1] and + linkgit:gitmodules[5]). + If the checkout is done via rebase, local submodule commits are rebased as well. + diff --git a/Documentation/git-read-tree.txt b/Documentation/git-read-tree.txt index 501f2ec375..5fa8bab64c 100644 --- a/Documentation/git-read-tree.txt +++ b/Documentation/git-read-tree.txt @@ -116,7 +116,7 @@ OPTIONS located in. --[no-]recurse-submodules:: - Using --recurse-submodules will update the content of all initialized + Using --recurse-submodules will update the content of all active submodules according to the commit recorded in the superproject by calling read-tree recursively, also setting the submodules' HEAD to be detached at that commit. diff --git a/Documentation/git-switch.txt b/Documentation/git-switch.txt index 79dbc9624d..3759c3a265 100644 --- a/Documentation/git-switch.txt +++ b/Documentation/git-switch.txt @@ -181,7 +181,7 @@ name, the guessing is aborted. You can explicitly give a name with --recurse-submodules:: --no-recurse-submodules:: Using `--recurse-submodules` will update the content of all - initialized submodules according to the commit recorded in the + active submodules according to the commit recorded in the superproject. If nothing (or `--no-recurse-submodules`) is used, submodules working trees will not be updated. Just like linkgit:git-submodule[1], this will detach `HEAD` of the