From patchwork Thu Jul 15 02:32:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Manz X-Patchwork-Id: 12378297 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0006C12002 for ; Thu, 15 Jul 2021 02:32:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9691B613CA for ; Thu, 15 Jul 2021 02:32:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236483AbhGOCfa (ORCPT ); Wed, 14 Jul 2021 22:35:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232435AbhGOCf2 (ORCPT ); Wed, 14 Jul 2021 22:35:28 -0400 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A9A1C061762 for ; Wed, 14 Jul 2021 19:32:36 -0700 (PDT) Received: by mail-wr1-x435.google.com with SMTP id m2so5666365wrq.2 for ; Wed, 14 Jul 2021 19:32:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=fHMUVvRL4P4XuScojtpjWOg0oCdfMZEVV7HmcvsxqVw=; b=uCNs9kPRreGhdQCxoR0LVk0GwLzpeRyTmR0PRDaiwYsUonzK9e0KSyvF/WZcrO+ftG +U0rset5Pah7EYesFWHPclm8cEp5y0BMOd6dhoMfEYCesvgZ4kd0HI6rG05Af2fcVdDS ++VLdqvxbRbwzDC4RSMLmTlyTyJrguFeVnQoLgemLu4Kyr7zvXSrWrduIoKGnwO4ep+D NzYn7AGPPTOOKXywPJPlLgaIh7D80+RDySwj5pfDIExX4tD4fk/5I8ezLsXadExBaPHY hyCpS8SEIqwTRqpWs+lHcOHIqjGOxuoNSbwU4m382v5GXLRnL93+7ZzpxKJB2er7etD/ dp9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=fHMUVvRL4P4XuScojtpjWOg0oCdfMZEVV7HmcvsxqVw=; b=b6to3zJWoaP8sHJFNvFf+tjz//aDDNGXB+kRS39hdQ/ozOnDhFTD1SjODjuFaZia3p hD5OoLfoJxJEjS4xznyKErIpgjTWoUDSr5SrtDlv3vd59hrk7EBoBNXJF5eiPJz4VA6s 8j0cHQ+Izoy/VBl/d6AYeTFLC7ANFypOMxGcallmLFpSAA3ciKavLjhaNtOknx7bpLmk yDhfCyXvypl4/IV2RoGJOqMsiYA1shOFzO51DFznokY0OqM6HrsX2f88UtSsGGEJ3uID GOFxyJY3EiT1UBYw5pJjh3BCpBbnuEPMBpbQPtOnxaqQfZuSJbQl0qyK/mWYwEpR1Tij +22g== X-Gm-Message-State: AOAM532PzgSkNiEMnmS+0D+HPot+E/emTvwrvJW/xOzXHx9yB0XXGmFh OkBg1BD3/Eay8lZJfDqrDjji6ZaPtw0= X-Google-Smtp-Source: ABdhPJx19vRy0n5TqCAg+IyxPqgHXl6YbrOM5trhWYjvwvgjTzoGjpIU4HQy7tz6JwPD7klySSp/VQ== X-Received: by 2002:adf:ce8d:: with SMTP id r13mr1771922wrn.304.1626316354559; Wed, 14 Jul 2021 19:32:34 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id j6sm4289552wrm.97.2021.07.14.19.32.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jul 2021 19:32:34 -0700 (PDT) Message-Id: <4b6bb50d3d66ce8b033c475fbb9d3bda672e2612.1626316350.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Thu, 15 Jul 2021 02:32:30 +0000 Subject: [PATCH v4 3/3] worktree: teach `add` to accept --reason with --lock Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Eric Sunshine , Stephen Manz , Stephen Manz Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Stephen Manz From: Stephen Manz The default reason stored in the lock file, "added with --lock", is unlikely to be what the user would have given in a separate `git worktree lock` command. Allowing `--reason` to be specified along with `--lock` when adding a working tree gives the user control over the reason for locking without needing a second command. Signed-off-by: Stephen Manz --- Documentation/git-worktree.txt | 4 ++-- builtin/worktree.c | 21 ++++++++++++++++----- t/t2400-worktree-add.sh | 14 ++++++++++++++ 3 files changed, 32 insertions(+), 7 deletions(-) diff --git a/Documentation/git-worktree.txt b/Documentation/git-worktree.txt index 66e67e6cbfa..8a7cbdd19c1 100644 --- a/Documentation/git-worktree.txt +++ b/Documentation/git-worktree.txt @@ -9,7 +9,7 @@ git-worktree - Manage multiple working trees SYNOPSIS -------- [verse] -'git worktree add' [-f] [--detach] [--checkout] [--lock] [-b ] [] +'git worktree add' [-f] [--detach] [--checkout] [--lock [--reason ]] [-b ] [] 'git worktree list' [--porcelain] 'git worktree lock' [--reason ] 'git worktree move' @@ -242,7 +242,7 @@ With `list`, annotate missing working trees as prunable if they are older than `