From patchwork Thu Feb 7 06:32:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denton Liu X-Patchwork-Id: 10800425 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 829091390 for ; Thu, 7 Feb 2019 06:33:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6F2522BF49 for ; Thu, 7 Feb 2019 06:33:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 630352CE4A; Thu, 7 Feb 2019 06:33:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1711D2D15D for ; Thu, 7 Feb 2019 06:33:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726896AbfBGGdB (ORCPT ); Thu, 7 Feb 2019 01:33:01 -0500 Received: from mail-pl1-f195.google.com ([209.85.214.195]:46621 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726636AbfBGGc5 (ORCPT ); Thu, 7 Feb 2019 01:32:57 -0500 Received: by mail-pl1-f195.google.com with SMTP id o6so4324334pls.13 for ; Wed, 06 Feb 2019 22:32:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=mBzWtj3T7gqnPP1dl4tRZxw54lnP6Ry+JvkzP7ry6gg=; b=ZoZMe7UpDTFlWTm6rEfbTnibsi97k+qZ4O4AS5+0CjGJ4pcytZiv4q7f0qHKMnjjpd fhAw1f8kGQ0sqqsNmUK4FziDPuOSFpoOmlj0zri78XoKa0kMy7wd5bMX934DzurxVbot JcINUdoNqoq8UMNFETHWG5cwIcd/29M1NR7o4wswlPVE4EWPNvuCQzD5lXKkpgfUWGjn dG3u0xqxgsZ0ubMZV1V2GrC6QIbQ2fSbIjEX7EEQxUFDVMPZIHBI7Q/f0EPXk6jAlbtw SRsjNxRhCOpNrBT1rtecwtl6Z4Maw6nOFW6YQt9dHuIFDphg9lKDasvK9lezs67IkBsy +mKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=mBzWtj3T7gqnPP1dl4tRZxw54lnP6Ry+JvkzP7ry6gg=; b=AT4UurnONzf9ZRqb1+imZNJBoaWuX3r0ZHDe1pEVXeaOqFjOm13UvQQLpuwU70a8ie 6372IgKzFIyQQZHQuwXIv5KhLuBKKL7Oh1s/HhRgJi7IHgCYlX+eyzViwirEjmiQEnYS SLCHfiVjb5roYMvvXS+wh8Nn6s3EdKaEnZ7V5QcrWYIrgTSmcqJxyt8wv9XxsCTWDOeh zqWnCOL1xsvEajc4eXU0+QvDrSXJtFtUTmbJwc0JNyWmMYS+7tbIY21fK9Fe//bQQO/r WOtIyOuq/V/hPSytIlQUHcNJ8jyTeEd2/8wwYObuvguojbcStDQQ5SPWamPyCh9xdkfH o16g== X-Gm-Message-State: AHQUAubY/cKf/RCpwr0Sa6Tv2RtpvJtEFDozHE5tGsiKpUqZTdlxhfNQ DX6nYp0brVLl9HOY4uHjV3LFa5li X-Google-Smtp-Source: AHgI3IZ5HiCJ97gWvF8z4jkAPm9Pr1cB8TaqlKuiwSJF6Na2a4Gpf8Ug83JEVKU04CjQg4/64auobQ== X-Received: by 2002:a17:902:27a8:: with SMTP id d37mr15065636plb.182.1549521176432; Wed, 06 Feb 2019 22:32:56 -0800 (PST) Received: from archbookpro.localdomain (c-73-222-73-77.hsd1.ca.comcast.net. [73.222.73.77]) by smtp.gmail.com with ESMTPSA id m67sm11148320pfm.73.2019.02.06.22.32.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 Feb 2019 22:32:55 -0800 (PST) Date: Wed, 6 Feb 2019 22:32:53 -0800 From: Denton Liu To: git@vger.kernel.org Cc: gitster@pobox.com Subject: [PATCH v2 0/3] Teach submodule set-branch subcommand Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.2 (2019-01-07) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Currently, there is no way to set the branch of a submodule without manually manipulating the .gitmodules file. This patchset introduces a porcelain command that enables this. Changes since v1: * Fixed incorrect usage of OPT_CMDMODE Denton Liu (3): git-submodule.txt: document default behavior without --branch submodule--helper: teach config subcommand --unset submodule: teach set-branch subcommand Documentation/git-submodule.txt | 10 ++- builtin/submodule--helper.c | 18 +++-- contrib/completion/git-completion.bash | 5 +- git-submodule.sh | 75 +++++++++++++++++++-- t/t7411-submodule-config.sh | 9 +++ t/t7419-submodule-set-branch.sh | 93 ++++++++++++++++++++++++++ 6 files changed, 198 insertions(+), 12 deletions(-) create mode 100755 t/t7419-submodule-set-branch.sh