From patchwork Thu Jul 8 15:50:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Manz X-Patchwork-Id: 12365411 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=-13.0 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_NONE,URIBL_BLOCKED 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 7FE12C07E96 for ; Thu, 8 Jul 2021 15:50:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6B68E61621 for ; Thu, 8 Jul 2021 15:50:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232174AbhGHPxi (ORCPT ); Thu, 8 Jul 2021 11:53:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232231AbhGHPx3 (ORCPT ); Thu, 8 Jul 2021 11:53:29 -0400 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8DFB0C061760 for ; Thu, 8 Jul 2021 08:50:46 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id p8so8153076wrr.1 for ; Thu, 08 Jul 2021 08:50:46 -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=i67g+3kM8fu0ZSxeCuCgoTqnwSExukN5fXsrjYMc2Vw=; b=GJQze7mdBOLP+OpcHgnQI3Jfo9KGSeau9dI76Re9gGAC/v901enCOyLiueLocOEZCs 0+E4K/n4fvciJTnsDPXhsoncgwYlyuEV+E4JhnFD9u65T0+5LJ9qAZzPa2738ZMc7+OS tavQDkUC44N77KB1d08FSrp6SpLkMcvDPcsppOsao+Qddk9iMHDEgn2YMtfk9BmzivQv QmCB9wpYQ6HkTQefl4HCXfWjCSAhtNtQo3qooTLhwicOExrcGEF2LwdZEPTosZKLJmGU KhwglaBk4VnNEYQGGjdGKYUFxnkbprHbeRUzGW9KjmSR9qBsZzAsgKgKG/yPGoI6Hias EDYA== 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=i67g+3kM8fu0ZSxeCuCgoTqnwSExukN5fXsrjYMc2Vw=; b=q8alFQrAzWqsC7o9N4EaReQfL7ekEZnLAl01ZvOAAAMOJg90E6J114Nxuud9rZWOeZ BU9JAPvLXoUauX+iD59U3E/Cn/XcEIUCiS1hPT3vzRtA/eQZuNM7gsjI0+Unl+3j5cUP fax42bMfgVVNluVQwNryW8tH3w2CSX2F1UDpYzYOOqAk1XNl+YcUG9AJ26mbKpMQih0D MMYJkX20JGecCua9f37U65sL4mlQhX5DYQ9FZfzv8k4ELmlGzEk2WowwvHqyW2NPpCPY TUaIBwx4AP5YV1jCchp1ewpyLAlie7L6tq7FU4NU2a+jjGgM5FdTNd/LM6FDW1v3ulIT plgQ== X-Gm-Message-State: AOAM530nhe7KCiQAgnKm7yrWeNyGa0A1KGJo+cS615rUQYcXWIEbWJOS sSut8yEFOLF15fMBLHi/PzLQdclmdcY= X-Google-Smtp-Source: ABdhPJyj/ZVxs2uiqQWEu7BuWedyRU/x6IbkI5t0bVQsxa6b+n+EPJvt317cQdI1PHqi9uN5NDAORw== X-Received: by 2002:a5d:5088:: with SMTP id a8mr33116706wrt.153.1625759445228; Thu, 08 Jul 2021 08:50:45 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id s3sm2635249wro.30.2021.07.08.08.50.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jul 2021 08:50:44 -0700 (PDT) Message-Id: <5459e5bb4212e47873d2862c4a96651c2f7d96b5.1625759443.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Thu, 08 Jul 2021 15:50:41 +0000 Subject: [PATCH v2 1/3] t2400: remove unneeded `git rev-parse` from '"add" worktree with lock' test 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 It must have come from a copy-paste of another test Signed-off-by: Stephen Manz --- t/t2400-worktree-add.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/t/t2400-worktree-add.sh b/t/t2400-worktree-add.sh index 96dfca15542..874a61dbfa7 100755 --- a/t/t2400-worktree-add.sh +++ b/t/t2400-worktree-add.sh @@ -67,7 +67,6 @@ test_expect_success '"add" worktree' ' ' test_expect_success '"add" worktree with lock' ' - git rev-parse HEAD >expect && git worktree add --detach --lock here-with-lock main && test -f .git/worktrees/here-with-lock/locked ' From patchwork Thu Jul 8 15:50:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Manz X-Patchwork-Id: 12365413 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=-13.0 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_NONE 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 EEE95C07E9E for ; Thu, 8 Jul 2021 15:50:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D92AC61621 for ; Thu, 8 Jul 2021 15:50:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232190AbhGHPxk (ORCPT ); Thu, 8 Jul 2021 11:53:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232180AbhGHPx3 (ORCPT ); Thu, 8 Jul 2021 11:53:29 -0400 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A319C061574 for ; Thu, 8 Jul 2021 08:50:47 -0700 (PDT) Received: by mail-wr1-x42a.google.com with SMTP id d2so8175001wrn.0 for ; Thu, 08 Jul 2021 08:50:47 -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=QZenG9y0QmFOmVqL2EUVba74mzw/GgCevkmWTft1JFs=; b=Jb0QtvXFGGJ86fVnPZ0yqg6a/Dk6ynR3WIETqXmUPZnZt5ajzoKGQqAH8xQ0KZL898 VstXSPMMz1Fae2Aez/bEXHEORKINyi7ArwJKkGsnBNsxmPzejjw2d07jcVI7+i1j1zeH rRXUaD6zCX8m5INeiESfiEuZDMQdEybcc4++C6rLhsHs4zb3fOU0FYoaz7q3O7JmxqX8 nxwTA3Tyv87K4uC3ZEAKXW3GQhhcoo12vG1/MM6VWxvg8E5k4OI2SMTX6qbjFTXsFi9j 34QmiQ10MQ1bUP7qFZT0kKyuyFs7maRh+RnWqOaqqGE88uE16KaWUsKp4s2JNUqTmDpo 4riA== 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=QZenG9y0QmFOmVqL2EUVba74mzw/GgCevkmWTft1JFs=; b=StpZOyBm2wCuJa1TkLIc2f+W3rFV9uBo7NKfR5BzgNiy6+TRyObZmKfPBuBdLHOAwk hyjxOA/WIClnvi0JAVBiECRRmP3+8A0FdfSc/Z6HK+IctOrM8YUYWGfG7LoOioGn4P6H z8sOiSiySX+WDVbdVIDKe9EXU3hHYmlg956G/UFWCIuE35kJB568xaec2vLKLvwahQSk sZH2Yp3VsDSnRXiVNJ9O+xMuPvLU08nV2/+pqH7L9RxeDcX4CEA/yRE8dqdAqe2wBUAq kDAy+VqRVhbwkSv7dwigdWdO9Galt4tuVJotNPyk+PH58E6FNSjkitD8++4i1HYdjt9m BgpA== X-Gm-Message-State: AOAM531gq4BzVZrE3yQEZvMiifJhuDtw40j03Y8iIpR1GJzJ7bcyVMZG +XItFC70nlot7XrNo+W5AtqOPAZGQSQ= X-Google-Smtp-Source: ABdhPJw6qhClPsgxv6kpYnu2qk6j524Dr9orqRcPsec148uo8eSZdl313YnP7tCH+dyrWuvA0zL02Q== X-Received: by 2002:adf:f642:: with SMTP id x2mr31921824wrp.37.1625759445812; Thu, 08 Jul 2021 08:50:45 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id 93sm1093925wrk.18.2021.07.08.08.50.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jul 2021 08:50:45 -0700 (PDT) Message-Id: <30196cc93697cd4a6a6881dcbb1073d19e96d8a0.1625759443.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Thu, 08 Jul 2021 15:50:42 +0000 Subject: [PATCH v2 2/3] worktree: default lock string should be marked with `_()` for translation 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 Signed-off-by: Stephen Manz --- builtin/worktree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/worktree.c b/builtin/worktree.c index 976bf8ed063..448ec69e745 100644 --- a/builtin/worktree.c +++ b/builtin/worktree.c @@ -305,7 +305,7 @@ static int add_worktree(const char *path, const char *refname, if (!opts->keep_locked) write_file(sb.buf, "initializing"); else - write_file(sb.buf, "added with --lock"); + write_file(sb.buf, _("added with --lock")); strbuf_addf(&sb_git, "%s/.git", path); if (safe_create_leading_directories_const(sb_git.buf)) From patchwork Thu Jul 8 15:50:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Manz X-Patchwork-Id: 12365415 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=-13.0 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_NONE,URIBL_BLOCKED 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 14AB3C11F66 for ; Thu, 8 Jul 2021 15:51:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 018C461621 for ; Thu, 8 Jul 2021 15:51:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232139AbhGHPxm (ORCPT ); Thu, 8 Jul 2021 11:53:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232102AbhGHPxb (ORCPT ); Thu, 8 Jul 2021 11:53:31 -0400 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B19DCC06175F for ; Thu, 8 Jul 2021 08:50:47 -0700 (PDT) Received: by mail-wr1-x42b.google.com with SMTP id a8so8121447wrp.5 for ; Thu, 08 Jul 2021 08:50:47 -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=+Y/TmwlBcAk8htzDjstcv+QUDvQTDluc2kzQtTQW4Hg=; b=b0ROeWQUHF0UUqcSdyHA9/qge+ohhy6RhvhbdPqgwmOPnzPPxLzAgDdDERfTyktOnW DWrFUPNsHoGE7huglD7516gTC08cAcDJa3hsiXfvfbFPXICHAT4BkMA397jWkTikn0gP qfWZFr5mMZpy5v7Geze/6uBHBStAF+uJD79BGTPoLPWbNUG9LESTxCbKAIIB1NSYz/iB HI6erA01ryVTzCdDV9CnxtbFOAvFgNlCNjZu27NsrqItAoMVttDnTURJBjZRC4ypgXtb 2p+j6ZWBEBDZiAaS5A8Jw67K5cudY5a74C2tQgHJEtBZH1gQ9gdFgTPxv6vvmmLMfqrw hOzQ== 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=+Y/TmwlBcAk8htzDjstcv+QUDvQTDluc2kzQtTQW4Hg=; b=TG1QnmxIkCdGQnlpz5Shx51PdE1rUA6ifEdUD0AL0WhEv+4lubWGptObsed03ICrl7 ylNmQqVeOKHDU49XFfWrtKa54whYMYHatB45Kketw1YFfqUwV7SN/XhzyNvRVxWQWvOL jDNajDfCpXs8sC+hWXbVjOs/sSg/XFYWgBFdOu7WDTrUzrAO9XfqKgz/hJA39cSiKZaG OikbNBCjFthLSLV9EBWMpVmqSSw5xyyfvbFybVF9EvUrgQgR5+XH6XiglhfreN5vnt8+ 68nA5a6i93k67rUEjqbp60W88BDRRFg8Bb4aFUZnmKRn/cTQMVmau2jxDeiFZWjP3DBB xS8g== X-Gm-Message-State: AOAM531u/1yX22HEFYh9L1j7n/nATp0RRJEXfP16Mp2eZDIboMbd4qCT wM0BHSB/K67zRJoksOg7iwDdcsl5MzU= X-Google-Smtp-Source: ABdhPJx7P3uuIsRp1oyQkBXwszbxo8PfryZGHL/rq8FYpbffmh+nRMXRx2RpeZ/8gBOWosnQ1IbnOg== X-Received: by 2002:a05:6000:12c7:: with SMTP id l7mr34032158wrx.177.1625759446402; Thu, 08 Jul 2021 08:50:46 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id a10sm2607058wrm.12.2021.07.08.08.50.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Jul 2021 08:50:46 -0700 (PDT) Message-Id: <4d17b31921ac775ad512d4de094b4718f5dd2eb3.1625759443.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Thu, 08 Jul 2021 15:50:43 +0000 Subject: [PATCH v2 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 | 7 +++++++ t/t2400-worktree-add.sh | 13 +++++++++++++ 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/Documentation/git-worktree.txt b/Documentation/git-worktree.txt index f1bb1fa5f5a..720663746ba 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 `