From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f51.google.com (mail-qv1-f51.google.com [209.85.219.51]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 65B0B2264A9 for ; Wed, 28 Jan 2026 05:39:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769578790; cv=none; b=ulqPnJhfK54wiKSlRR9XhKSRRtKulQChLttGpoWJskbh+y/Wht1xCppEUNk7d16xJNGQmP/M3GtWp8SNsRtGmql4fg5g3iOaHNC1wVqSh52sETw8nBlgt27VwseEdHMdM0E97XtQQlMA4qs16nQNEtvgSrwe2sVsmB7XrGD4NTU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769578790; c=relaxed/simple; bh=zzLa+2OeiOzymppPPLFFg1Pry1JwYo2T/7LzpDBrvUc=; h=Message-Id:In-Reply-To:References:From:Date:Subject:Content-Type: MIME-Version:To:Cc; b=IXm0qCJu+u44eQKf9ZmYH6KrM/jAXZlljW3GMRs5TjYxGoxz0ehaNM34vKQDeT5rzx+hvQM0zic3HtB1g6ZdJOovr2iQYL+dZZ06N4cSi1kEiMaOS2Y//PauCe3Ky3vI53Zeei38VgqgO0aJBbFiLOHDjIeaaIVjxP6lj+WJgTQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=jtZfjw0P; arc=none smtp.client-ip=209.85.219.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jtZfjw0P" Received: by mail-qv1-f51.google.com with SMTP id 6a1803df08f44-894770e34afso106010816d6.0 for ; Tue, 27 Jan 2026 21:39:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769578787; x=1770183587; darn=vger.kernel.org; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=Y/Psu++vvZgvJp3FMORh2bmneX9C3hfFtExAQQyv2b4=; b=jtZfjw0PmAcLVrFDMRUR3BoG067VbuVNuzbjdY0JOP+Tr2VaiBAaPR2PP5HyAnq60Q AvB8+SLHxWIkOdeZ/L4MujU6Y7xoONnfL0BmhmjIlTmugMYku8c8dMY9cP4PH5tiwbuE ohNNQr+C/sdnDZtSOWTHoJSzO1+vPL5MFjFf6pL5/dE1lPklaw1KTAsd5rrJtTjyRWS5 VJfgJFvIFw619UDfWGHxYK1rd4Cim4Nb4MSO9gfmJhpIRMTIQ53JH0zVRI6z/Ymt2yLH LB2kd2yVgh6eRyqG5B8rtK+aXaax0pXPjltXM0HMWHlzn2eA2sc8My7HSYA1u7+YGdFX 2Srg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769578787; x=1770183587; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Y/Psu++vvZgvJp3FMORh2bmneX9C3hfFtExAQQyv2b4=; b=pBOPklS/Knguvs5Bqj9hCdxRuBzwST2kmu31Bk8bttK8h982dJXCes1wECe9Lrikdq XUdt4wg/6TfrAwddtfDYBtx8Dj/4TNdqIBzJtyejE58TUpNXXs16Rrxa1zavUv1vKZx4 rRW5I2lQr3XtfYHUGVT/Ur6DTTJTx7jNP0Nrotn1O6WrbaHgA/vAcevHr67iSz6KdWnA CjmzmY3el8qEhQizaGubWeP3f0b3AmS8lucplXOKgFQtOUsHG5kfpRQiOnDBdwsr05An U4ESoqYIRVM8+Zb49l6cBwIMkhK2JiwtjIw/NAgs8Z5igaYNlxDz4/h8yua4NjKoir4Q m9IQ== X-Gm-Message-State: AOJu0YxDLmIV+uD2f6GQf7BrF6qbsjz1Dc2xcVbEC48jPjRIlBhXI78w aqSScflNqyluljjgQXN87nbr2Xll6UvxpYFqsD83sxpnu5iefLTX4ZnHWj6sVw== X-Gm-Gg: AZuq6aI4S1IaIMRy8hT+sRamVM+mAoH4RBhHI/xxww+XpM049j/2JNqiFEcnvnsxS/h QxsylJ86oJF6OPtMCtS28EOg+EWbEpd3Y0a4PJqVU839fDk1WRV1mzM6yiEtVwK1MlbycjN6W7h 3E6pyvMxWaMJExrOndTpZI9/CMVpefAoXhf734fFK4uoI/uj81ZFuzzWeS0PT8nQUaC+9PpXrLY 2UVkxWhiILRqkAwlOj8Im3+Pgz6F201jLrz0dgt5tN4aEd+SoK508Iu+aCqjSGxrSdmR1KH09xS VAw2ZlD8B1UXasJxisFLqNcSolYMV9+vKXg9j3OFxEXWgPKw3NMai/fXhwsYyaJROXrddSWx+p4 Dh1opvGwk/rdCBgIFFlcFE+2IA/ztdjtXHIeUecgeuvOFiruzmYXdtcEL9+UrLph7r+PnvDmo9E ceFkIkrTvIcqd2GO2b4QGrpgr/ X-Received: by 2002:a05:6214:e61:b0:880:3ce2:65ad with SMTP id 6a1803df08f44-894cc8fc097mr58380186d6.41.1769578786605; Tue, 27 Jan 2026 21:39:46 -0800 (PST) Received: from [127.0.0.1] ([135.232.200.67]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-894d3740e62sm10963736d6.26.2026.01.27.21.39.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jan 2026 21:39:46 -0800 (PST) Message-Id: In-Reply-To: References: From: "Sam Bostock via GitGitGadget" Date: Wed, 28 Jan 2026 05:39:45 +0000 Subject: [PATCH v3] worktree: clarify that --expire only affects missing worktrees Fcc: Sent Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 To: git@vger.kernel.org Cc: Eric Sunshine , Sam Bostock , Sam Bostock From: Sam Bostock The --expire option for "git worktree list" and "git worktree prune" only affects worktrees whose working directory path no longer exists. The help text did not make this clear, and the documentation inconsistently used "unused" for prune but "missing" for list. Update the help text and documentation to consistently describe these as "missing worktrees", and use "prune" instead of "expire" when describing the effect on missing worktrees since the terminology is clearer. While at it, expand the description of the "prune" subcommand itself to better explain what it does and when to use it, as suggested by Junio. Helped-by: Eric Sunshine Helped-by: Junio C Hamano Signed-off-by: Sam Bostock --- worktree: clarify --expire applies to missing worktrees Changes from v2: * Squash into a single commit * Expand the prune subcommand description per Junio's suggestion Changes from v1: * Use "prune" instead of "expire" in help text Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-2135%2Fsambostock%2Fexpire-missing-worktrees-v3 Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-2135/sambostock/expire-missing-worktrees-v3 Pull-Request: https://github.com/git/git/pull/2135 Range-diff vs v2: 1: ddd4191ecb ! 1: a4483d9a20 worktree: clarify --expire applies to missing worktrees @@ Metadata Author: Sam Bostock ## Commit message ## - worktree: clarify --expire applies to missing worktrees + worktree: clarify that --expire only affects missing worktrees - The `--expire` option for `git worktree list` and `git worktree prune` + The --expire option for "git worktree list" and "git worktree prune" only affects worktrees whose working directory path no longer exists. The help text did not make this clear, and the documentation inconsistently used "unused" for prune but "missing" for list. - This updates the help text and documentation to consistently describe - these as "missing worktrees". + Update the help text and documentation to consistently describe these + as "missing worktrees", and use "prune" instead of "expire" when + describing the effect on missing worktrees since the terminology is + clearer. + While at it, expand the description of the "prune" subcommand itself + to better explain what it does and when to use it, as suggested by + Junio. + + Helped-by: Eric Sunshine + Helped-by: Junio C Hamano Signed-off-by: Sam Bostock ## Documentation/git-worktree.adoc ## +@@ Documentation/git-worktree.adoc: with linked worktrees if you move the main worktree manually.) + + `prune`:: + +-Prune worktree information in `$GIT_DIR/worktrees`. ++Remove worktree information in `$GIT_DIR/worktrees` for worktrees ++whose working trees are missing. Useful after manually removing ++a working tree that is no longer needed (but use "git worktree ++remove" next time you want to do so). Also, if you _moved_ a ++working tree elsewhere causing the worktree information to become ++dangling, see "git worktree repair" to reconnect the worktree to ++the new working tree location. + + `remove`:: + @@ Documentation/git-worktree.adoc: mismatch, even if the links are correct. With `list`, output additional information about worktrees (see below). `--expire