git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gabriel Scherer <gabriel.scherer@gmail.com>
To: Kristoffer Haugsbakk <kristofferhaugsbakk@fastmail.com>,
	Patrick Steinhardt <ps@pks.im>
Cc: Matthieu Moy <git@matthieu-moy.fr>,
	git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>,
	Elijah Newren <newren@gmail.com>,
	Eric Sunshine <sunshine@sunshineco.com>,
	Todd Zullinger <tmz@pobox.com>
Subject: Re: [PATCH v3 10/11] contrib: remove "git-new-workdir"
Date: Mon, 8 Sep 2025 17:22:42 +0200	[thread overview]
Message-ID: <e6003a2c-bc1b-4cf5-aae7-ef5aa9c82f10@gmail.com> (raw)
In-Reply-To: <2b3c951b-0400-4cc5-b790-17ff77154ec2@app.fastmail.com>


On 08/09/2025 11:58, Kristoffer Haugsbakk wrote:
> On Mon, Sep 8, 2025, at 11:28, Gabriel Scherer wrote:
>> Dear git developers,
>>
>> I find myself affected by the removal of the `git-new-workdir` script
>> which is a relatively common part of my workflow. I am writing to ask
>> if it might be possible to reinstate the script in `contrib`, and also
>> possibly create a discussion with other users affected.
>>
>> (The removal of the script was released in git 2.51, three weeks ago.)
> Did you run into this issue when upgrading from 2.50 to 2.51 or from an
> older version?  Was it simple to troubleshoot that the script was gone?

I create a new workdir by manually running
/usr/share/doc/git/contrib/workdir/git-new-workdir, so indeed I
quickly found out that the wordir/ folder was gone and this was
clearly a git-side packaging change.

> Just curious.  I’m as naïve about release management as any
> random person!
>
>>
>> Thanks for your work on git!
>>
>>
>> ## Details/comments
>>
>>   > The command thus predates git-worktree(1), which is what people use
>>   > nowadays to create any such working directory. As such, the script
>>   > doesn't really have much of a reason to exist nowadays anymore.
>>
>> `git worktree` suffers from the substantial restriction that it is not
>> allowed for two worktrees to checkout the same branch.
> You can override that restriction with `--force`.[1]
>
> † 1: Naming override options just `--force` has some UX issues like
>      discoverability and the fact that (in this case) it is used for
>      multiple orthogonal things

Thanks. I just tried this, but I think it does not suffice. The --force
option is available to "git worktree add" to create a worktree for a
branch that is already checked out. But typically my workflow is to
create a worktree for a new feature branch, and there from that worktree
temporarily switch to an existing branch using `git checkout`, and there
I get a hard error (if another worktree has this branch) and there is no
--force option to override the worktree limitation at 'checkout' time. I
just tried to test whether worktrees created with --force would allow to
switch to checked-out-in-other-worktrees branches in the future, but
that does not appear to be the case.


>> I understand
>> why its designers felt that this would provide better guarantees (it
>> is not a good idea to mutate branch names that are checked out
>> somewhere else), but checking out various branches to test them and
>> inspect their code (before returning to the feature branch I am
>> actively working on) is a common part of my workflow.
> I agree, that’s a great use of worktrees.  But I never feel like I have
> to checkout the branch itself.  I detach on top of the branch.


I'm afraid `git checkout -d` is not part of my typical git workflow. I
could retrain myself to use it, when I get into a worktree error, but it
is cumbersome to know of this new complexity¹, and various things work
less well in detached state -- for example my bash prompt tells me in
which branch I am, and in detached state it only shows the commit hash.

¹: it would be nice if the fatal-error message on 'git checkout' when
trying to checkout a branch that is active on another worktree would
suggest using `git checkout -d` instead to proceed. I may try to send a
patch to add this information.

>> Getting a 'fatal
>> error' because some other, independent worktree also checked this
>> branch out is a hindrance.
>>
>> Note: I don't know about the `worktree` implementation and whether the
>> [snip]

  reply	other threads:[~2025-09-08 15:22 UTC|newest]

Thread overview: 87+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-06 14:12 [PATCH 00/10] Spring cleanup of "contrib/" Patrick Steinhardt
2025-05-06 14:12 ` [PATCH 01/10] contrib: remove "remotes2config.sh" Patrick Steinhardt
2025-05-06 19:52   ` Junio C Hamano
2025-05-07  6:27     ` Patrick Steinhardt
2025-05-07 17:21       ` Junio C Hamano
2025-05-06 14:12 ` [PATCH 02/10] contrib: remove "examples" directory Patrick Steinhardt
2025-05-06 14:12 ` [PATCH 03/10] contrib: remove remote-helper stubs Patrick Steinhardt
2025-05-06 14:12 ` [PATCH 04/10] contrib: remove "thunderbird-patch-inline" Patrick Steinhardt
2025-05-06 14:12 ` [PATCH 05/10] contrib: remove "hooks" directory Patrick Steinhardt
2025-05-06 14:12 ` [PATCH 06/10] contrib: remove "mw-to-git" Patrick Steinhardt
2025-05-06 20:34   ` Junio C Hamano
2025-05-07  9:11     ` Matthieu Moy
2025-05-06 14:12 ` [PATCH 07/10] contrib: remove "persistent-https" remote helper Patrick Steinhardt
2025-05-06 20:25   ` Junio C Hamano
2025-05-06 14:12 ` [PATCH 08/10] contrib: remove "git-resurrect.sh" Patrick Steinhardt
2025-05-06 20:11   ` Junio C Hamano
2025-05-07  6:58     ` Patrick Steinhardt
2025-05-07 17:48       ` Junio C Hamano
2025-05-07 18:36     ` Kristoffer Haugsbakk
2025-05-06 14:12 ` [PATCH 09/10] contrib: remove "emacs" directory Patrick Steinhardt
2025-05-06 19:59   ` Junio C Hamano
2025-05-06 14:12 ` [PATCH 10/10] contrib: remove "git-new-workdir" Patrick Steinhardt
2025-05-06 19:57   ` Junio C Hamano
2025-05-07  6:27     ` Patrick Steinhardt
2025-05-07 17:25       ` Junio C Hamano
2025-05-09  7:53         ` Patrick Steinhardt
2025-05-06 20:43 ` [PATCH 00/10] Spring cleanup of "contrib/" Junio C Hamano
2025-05-06 22:51   ` Eric Sunshine
2025-05-07  1:32     ` Todd Zullinger
2025-05-07  3:55       ` Eric Sunshine
2025-05-07  6:27         ` Patrick Steinhardt
2025-05-10 20:07         ` D. Ben Knoble
2025-05-12 13:10           ` Phillip Wood
2025-05-09  9:17 ` [PATCH v2 00/11] " Patrick Steinhardt
2025-05-09  9:17   ` [PATCH v2 01/11] contrib: remove "remotes2config.sh" Patrick Steinhardt
2025-05-09  9:17   ` [PATCH v2 02/11] contrib: remove "examples" directory Patrick Steinhardt
2025-05-09  9:17   ` [PATCH v2 03/11] contrib: remove remote-helper stubs Patrick Steinhardt
2025-05-09  9:17   ` [PATCH v2 04/11] contrib: remove "thunderbird-patch-inline" Patrick Steinhardt
2025-05-09  9:17   ` [PATCH v2 05/11] contrib: remove "hooks" directory Patrick Steinhardt
2025-05-09  9:17   ` [PATCH v2 06/11] contrib: remove "mw-to-git" Patrick Steinhardt
2025-05-09  9:17   ` [PATCH v2 07/11] contrib: remove "persistent-https" remote helper Patrick Steinhardt
2025-05-09  9:17   ` [PATCH v2 08/11] contrib: remove "git-resurrect.sh" Patrick Steinhardt
2025-05-09  9:17   ` [PATCH v2 09/11] contrib: remove "emacs" directory Patrick Steinhardt
2025-05-09  9:17   ` [PATCH v2 10/11] contrib: remove "git-new-workdir" Patrick Steinhardt
2025-05-09  9:17   ` [PATCH v2 11/11] contrib: remove "stats" directory Patrick Steinhardt
2025-05-09 23:31     ` Elijah Newren
2025-05-09 23:53   ` [PATCH v2 00/11] Spring cleanup of "contrib/" Elijah Newren
2025-05-10  0:00     ` Junio C Hamano
2025-05-12  9:39     ` Patrick Steinhardt
2025-05-12  4:05   ` [PATCH v2 04/11] contrib: remove "thunderbird-patch-inline" Collin Funk
2025-05-12 13:02     ` Phillip Wood
2025-05-12 14:45       ` Patrick Steinhardt
2025-05-12 16:22       ` Junio C Hamano
2025-05-14 15:19         ` Phillip Wood
2025-05-16 13:53       ` [PATCH v2] contrib: update thunderbird-patch-inline Phillip Wood
2025-05-16 14:05         ` Kristoffer Haugsbakk
2025-05-19  5:38         ` Patrick Steinhardt
2025-05-19  5:50           ` Collin Funk
2025-05-19 14:21           ` Phillip Wood
2025-06-03 22:12             ` Junio C Hamano
2025-05-19 15:48           ` Junio C Hamano
2025-05-10 12:30 ` [PATCH 00/10] Spring cleanup of "contrib/" Peter Krefting
2025-05-12  9:19 ` [PATCH v3 00/11] " Patrick Steinhardt
2025-05-12  9:19   ` [PATCH v3 01/11] contrib: remove "remotes2config.sh" Patrick Steinhardt
2025-05-12  9:19   ` [PATCH v3 02/11] contrib: remove "examples" directory Patrick Steinhardt
2025-05-12  9:19   ` [PATCH v3 03/11] contrib: remove remote-helper stubs Patrick Steinhardt
2025-05-12  9:19   ` [PATCH v3 04/11] contrib: remove "thunderbird-patch-inline" Patrick Steinhardt
2025-05-16 22:49     ` Junio C Hamano
2025-05-26  8:47       ` Toon Claes
2025-06-04 14:45       ` Junio C Hamano
2025-05-12  9:19   ` [PATCH v3 05/11] contrib: remove "hooks" directory Patrick Steinhardt
2025-05-12  9:19   ` [PATCH v3 06/11] contrib: remove "mw-to-git" Patrick Steinhardt
2025-05-12  9:19   ` [PATCH v3 07/11] contrib: remove "persistent-https" remote helper Patrick Steinhardt
2025-05-12  9:19   ` [PATCH v3 08/11] contrib: remove "git-resurrect.sh" Patrick Steinhardt
2025-05-12  9:19   ` [PATCH v3 09/11] contrib: remove "emacs" directory Patrick Steinhardt
2025-05-12  9:20   ` [PATCH v3 10/11] contrib: remove "git-new-workdir" Patrick Steinhardt
2025-09-08  9:28     ` Gabriel Scherer
2025-09-08  9:58       ` Kristoffer Haugsbakk
2025-09-08 15:22         ` Gabriel Scherer [this message]
2025-09-12 18:14           ` D. Ben Knoble
2025-09-12 18:55             ` Gabriel Scherer
2025-09-12 22:21               ` Junio C Hamano
2025-09-12 20:05           ` Phillip Wood
2025-09-12 22:19             ` Junio C Hamano
2025-09-08 18:43         ` Junio C Hamano
2025-05-12  9:20   ` [PATCH v3 11/11] contrib: remove some scripts in "stats" directory Patrick Steinhardt
2025-05-13  2:53   ` [PATCH v3 00/11] Spring cleanup of "contrib/" Elijah Newren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e6003a2c-bc1b-4cf5-aae7-ef5aa9c82f10@gmail.com \
    --to=gabriel.scherer@gmail.com \
    --cc=git@matthieu-moy.fr \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=kristofferhaugsbakk@fastmail.com \
    --cc=newren@gmail.com \
    --cc=ps@pks.im \
    --cc=sunshine@sunshineco.com \
    --cc=tmz@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).