From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Subject: [PATCH v4 4/6] worktree: add "lock" command Date: Fri, 3 Jun 2016 19:19:42 +0700 Message-ID: <20160603121944.28980-5-pclouds@gmail.com> References: <20160530104939.28407-1-pclouds@gmail.com> <20160603121944.28980-1-pclouds@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Junio C Hamano , Eric Sunshine , rethab.ch@gmail.com, rappazzo@gmail.com, =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Fri Jun 03 14:20:37 2016 Return-path: Envelope-to: gcvg-git-2@plane.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1b8o5a-00034l-CH for gcvg-git-2@plane.gmane.org; Fri, 03 Jun 2016 14:20:34 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752099AbcFCMUc convert rfc822-to-quoted-printable (ORCPT ); Fri, 3 Jun 2016 08:20:32 -0400 Received: from mail-pa0-f68.google.com ([209.85.220.68]:33660 "EHLO mail-pa0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751963AbcFCMU3 (ORCPT ); Fri, 3 Jun 2016 08:20:29 -0400 Received: by mail-pa0-f68.google.com with SMTP id di3so5914556pab.0 for ; Fri, 03 Jun 2016 05:20:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=GasH5afcgHjG1b6Bx+h9WGvYhJ0ADTnAIpMSQ6QX6H8=; b=IWcqNlb5hxZghBUQNKSl1GLhFzptWZLHXj/DcWysbuB2Bs6yHZWyO/6ejG+bWU43Vx LL/38ZqkxBA8YS+sluO4JssXaAuW3g02rohDqq26HWjvMy2V9UwRWDITTxjxZ7Hwpnru pd5ubU6DAHjdcvMoY4vnQdl1JuTjX6FtPhrCZJl1SRJH5l5kPD67ZmufItjmfpCdg7hX tjiNXJqnQRMvb97n6MtWaqElwRJVjo0o7skkxxb+36ytqTIHw7NL+kYI9vSP+D+ldJ9Q OeNbSmaJ8ERPkUQYGbcPau7uTtVQo3zO8K11MO2qRYPUcOP4XdKB1CugAbT9goXJTy8G ptsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=GasH5afcgHjG1b6Bx+h9WGvYhJ0ADTnAIpMSQ6QX6H8=; b=Uu6TigK+Je52dCbbmrrGUBBNLN3Cv9B/NSWmiqbWe7NM6LqgNiWYd3OtNA7ol3ygc8 AiHywzJf/tvuSvWwxRYtIYWIOFNdAE/2b+ToEvcaLpk1Pp4io23ko6rcZi7shfWa9SOP MjlOxX80rOBQqh0makstIf1xB8st4K1FkEAjQhyugZpbIoGU9uRpODavciIKAnQshFQp ClxzbWddxFwxnZUPXLE52ZwQl6RTmAeToIIwwTHcpH0mdWC2US/+cVuCPzocKuK43ce0 RmkE00tSsnHlh7LgZUeTLNotroEetOKri+4uL+l+3gVvCVwT9zR9guiji9rEzL+PIrgy xcjA== X-Gm-Message-State: ALyK8tIPNympsvI6FIhLTA2bWEV/d1sbI3rxGpjB8CauNdNVQbOBjCuiYzS9X3D0W5kGoQ== X-Received: by 10.66.197.202 with SMTP id iw10mr4970955pac.148.1464956428970; Fri, 03 Jun 2016 05:20:28 -0700 (PDT) Received: from ash ([171.232.119.25]) by smtp.gmail.com with ESMTPSA id w23sm8178469pfa.38.2016.06.03.05.20.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Jun 2016 05:20:28 -0700 (PDT) Received: by ash (sSMTP sendmail emulation); Fri, 03 Jun 2016 19:20:23 +0700 X-Mailer: git-send-email 2.8.2.524.g6ff3d78 In-Reply-To: <20160603121944.28980-1-pclouds@gmail.com> Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: Helped-by: Eric Sunshine Signed-off-by: Nguy=E1=BB=85n Th=C3=A1i Ng=E1=BB=8Dc Duy --- Documentation/git-worktree.txt | 26 +++++++++++++----- builtin/worktree.c | 38 ++++++++++++++++++++++++++= + contrib/completion/git-completion.bash | 5 +++- t/t2028-worktree-move.sh (new +x) | 48 ++++++++++++++++++++++++++= ++++++++ 4 files changed, 110 insertions(+), 7 deletions(-) create mode 100755 t/t2028-worktree-move.sh diff --git a/Documentation/git-worktree.txt b/Documentation/git-worktre= e.txt index 7c4cfb0..d233d61 100644 --- a/Documentation/git-worktree.txt +++ b/Documentation/git-worktree.txt @@ -11,6 +11,7 @@ SYNOPSIS [verse] 'git worktree add' [-f] [--detach] [--checkout] [-b ] [] 'git worktree list' [--porcelain] +'git worktree lock' [--reason ] 'git worktree prune' [-n] [-v] [--expire ] =20 DESCRIPTION @@ -38,9 +39,8 @@ section "DETAILS" for more information. =20 If a linked working tree is stored on a portable device or network sha= re which is not always mounted, you can prevent its administrative files = from -being pruned by creating a file named 'locked' alongside the other -administrative files, optionally containing a plain text reason that -pruning should be suppressed. See section "DETAILS" for more informati= on. +being pruned by issuing the `git worktree lock` command, optionally +specifying `--reason` to explain why the working tree is locked. =20 COMMANDS -------- @@ -62,6 +62,14 @@ each of the linked worktrees. The output details in= clude if the worktree is bare, the revision currently checked out, and the branch currently che= cked out (or 'detached HEAD' if none). =20 +lock:: + +If a working tree is on a portable device or network share which +is not always mounted, lock it to prevent its administrative +files from being pruned automatically. This also prevents it from +being moved or deleted. Optionally, specify a reason for the lock +with `--reason`. + prune:: =20 Prune working tree information in $GIT_DIR/worktrees. @@ -111,6 +119,13 @@ OPTIONS --expire