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=-4.8 required=3.0 tests=AWL,BAYES_00,BODY_8BITS, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 6390C1F4D7 for ; Thu, 12 May 2022 22:42:19 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="m0FCiV5b"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359242AbiELWmO (ORCPT ); Thu, 12 May 2022 18:42:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231395AbiELWmN (ORCPT ); Thu, 12 May 2022 18:42:13 -0400 Received: from mail-qk1-x72f.google.com (mail-qk1-x72f.google.com [IPv6:2607:f8b0:4864:20::72f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67C9D28244B for ; Thu, 12 May 2022 15:42:12 -0700 (PDT) Received: by mail-qk1-x72f.google.com with SMTP id c1so5865984qkf.13 for ; Thu, 12 May 2022 15:42:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=fgNFWBpcCPgrhhyJjPDS1vi3h1PtoWORwDUhSwREwts=; b=m0FCiV5bW64TZfGc7EplqHmMOFV/GVpjvqNkfOiWWpSCZgEHDeVRqjtQX+z6d+bGm0 fcoYua3kSDRoamN/SKvV82RWr8fjfUtjCF9daUDsikH7M/ixCnkW6k7XGzP+rmdaTbFW lNs5oETWlaUMSEPGPqSJ9W814BDNi5NOW1Xd686IGy+X2Ox+m+3QxaOV04nMurrEEeGu oa+a8/D0auxMxUWGYU5/8tEOnog88SOP/yIz2XbVrV2TUQ4pakLJs2DIVr6leNuDZ+9a Eh8GRZBOMBRDkZTEE08m2WXX1csnBgYsA58JQylY9ySrojrCeJ/dcXh0tnK2R/sZJYuy PnOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=fgNFWBpcCPgrhhyJjPDS1vi3h1PtoWORwDUhSwREwts=; b=kO9omdCwlhnARtH82JSPFSFugQI7hf5dV8uC02dFBYbB0/YTFHLrEGrVx99SZ+mXOX uqXdzXXeHfRI/sFy/LSY0BZjsfbJNJ7Hjz8qtNViHaUbRPBuQsda396ulQM9OntkrNsa 4cICuvmZfZPp4AyzZJTpCzSkQ6G8KWxplPl+WAEcqM1wxAFCQkLJz6BT2wIPrGHLqaC8 hLfIcvyU5Hi3Xqyx4+wsxEHJlG/ALS+H0M0oa/isslYeCC4+OLc3Vrg2zj+CVgscZNOS NuEmKJHHwXI9iarBDOC1By3X2IcXi5PWuZ5tPKxtWAzCZTow5Id3fO5Pz6bXaFCp7364 HFJw== X-Gm-Message-State: AOAM533rCwCqO34hjqd55+aYmwgOBtjptg5r2eCeeigOTFSu8AF6DPdD cYK9+SA5focDF+xyVELjr3k/m6eVML4V3A== X-Google-Smtp-Source: ABdhPJzm03lBSjHzJdyZzWSTJHyb7A8Alv5lfVfny7dq6zUp7nUcqpJOVN8EROHcq0uqDfs6JaNO5g== X-Received: by 2002:a05:620a:1529:b0:69f:e354:c71f with SMTP id n9-20020a05620a152900b0069fe354c71fmr1720611qkk.375.1652395331471; Thu, 12 May 2022 15:42:11 -0700 (PDT) Received: from [192.168.1.127] (173-246-5-136.qc.cable.ebox.net. [173.246.5.136]) by smtp.gmail.com with ESMTPSA id a18-20020a05622a02d200b002f3f087c919sm540795qtx.97.2022.05.12.15.42.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 12 May 2022 15:42:10 -0700 (PDT) Subject: Re: Git Submodules ref setting To: =?UTF-8?B?0JLQsNC00LjQvCDQptCy0LXRgtC60L7Qsg==?= , git@vger.kernel.org, Philip Oakley References: From: Philippe Blain Message-ID: <88fa7138-cb3f-ab88-525c-198396b0a262@gmail.com> Date: Thu, 12 May 2022 18:42:09 -0400 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: fr Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Hi, Le 2022-05-12 à 16:01, Вадим Цветков a écrit : > Hello, > > I've started a small project which involves several git repositories, which depends on each other. > For dealing with these repos I wanted to use git submodules as a simple package manager. > However, it seems impossible to lock a submodule to particular ref, only to a branch. Submodules are recorded in the superproject *at a specific commit*. That's the data model. There is no other options. There is a 'branch' setting that you can put in '.gitmodules'. This *only* affects the command 'git submodule update --remote', nothing else. If you mean that you would like to have a non-branch ref recorded in '.gitmodules' i.e. something like refs/other-refs/example instead of 'some-branch' that corresponds to 'refs/heads/some-branch', then no this is not possible either. > I would like to ask if this is deliberate design choice? Yes, it was a deliberate design choice to have a deterministic state of a repository using submodules upon 'git clone'. Recording a submodule at a specific branch instead of at a specific commit would make this design choice impossible to achieve. > And if it's not, may I contribute this feature? > It depends on what you mean by 'lock submodule to a specific ref'. I encourage you to read the "Git Submodules" chapter of the Pro Git book [1] for an in-depth overview of how submodules work. And after that, for reference the Git documentation: - git-submodule(1): https://git-scm.com/docs/git-submodule - gitsubmodules(7): https://git-scm.com/docs/gitsubmodules - gitmodules(5): https://git-scm.com/docs/gitmodules I hope that helps, Philippe. [1] https://git-scm.com/book/en/v2/Git-Tools-Submodules