git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v3 10/11] contrib: remove "git-new-workdir"

From
D. Ben Knoble <ben.knoble@gmail.com>
Date
Sep 12, 2025, 18:14 UTC
Message-ID
<CALnO6CBDcDEXe3a_mpdwTi7ujL-fU5QrDeK704X+5bbkpNgb5w@mail.gmail.com>
In-Reply-To
<e6003a2c-bc1b-4cf5-aae7-ef5aa9c82f10@gmail.com>

On Mon, Sep 8, 2025 at 11:23 AM Gabriel Scherer <gabriel.scherer@gmail.com> wrote:

Show 17 quoted lines
> On 08/09/2025 11:58, Kristoffer Haugsbakk wrote:
> > On Mon, Sep 8, 2025, at 11:28, Gabriel Scherer wrote:
> >> 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.

From a quick glance, the old script symlinks various repository state together. You could probably get something equally useful out of

    git clone --shared . ../new-worktree
(Provide branch options, etc., as desired?)

With "git config --global alias.new-workdir 'clone --shared'" or similar, you might even have less finger re-training to do.

Alternatively, you could maintain the script yourself by e.g. copying it to somewhere on your $PATH or extracting the contrib/workdir history into a repo of your choice.

-- 
D. Ben Knoble
Previous: Gabriel SchererNext: Gabriel Scherer
Message 18 of 25 in “Spring cleanup of "contrib/"”
  1. 00/11 Spring cleanup of "contrib/"Patrick Steinhardt, May 12, 2025
  2. 01/11 contrib: remove "remotes2config.sh"Patrick Steinhardt, May 12, 2025
  3. 02/11 contrib: remove "examples" directoryPatrick Steinhardt, May 12, 2025
  4. 03/11 contrib: remove remote-helper stubsPatrick Steinhardt, May 12, 2025
  5. 04/11 contrib: remove "thunderbird-patch-inline"Patrick Steinhardt, May 12, 2025
  6. Junio C HamanoMay 16, 2025
  7. Toon ClaesMay 26, 2025
  8. Junio C HamanoJun 4, 2025
  9. 05/11 contrib: remove "hooks" directoryPatrick Steinhardt, May 12, 2025
  10. 07/11 contrib: remove "persistent-https" remote helperPatrick Steinhardt, May 12, 2025
  11. 06/11 contrib: remove "mw-to-git"Patrick Steinhardt, May 12, 2025
  12. 08/11 contrib: remove "git-resurrect.sh"Patrick Steinhardt, May 12, 2025
  13. 09/11 contrib: remove "emacs" directoryPatrick Steinhardt, May 12, 2025
  14. 10/11 contrib: remove "git-new-workdir"Patrick Steinhardt, May 12, 2025
  15. Gabriel SchererSep 8, 2025
  16. Kristoffer HaugsbakkSep 8, 2025
  17. Gabriel SchererSep 8, 2025
  18. D. Ben KnobleSep 12, 2025
  19. Gabriel SchererSep 12, 2025
  20. Junio C HamanoSep 12, 2025
  21. Phillip WoodSep 12, 2025
  22. Junio C HamanoSep 12, 2025
  23. Junio C HamanoSep 8, 2025
  24. 11/11 contrib: remove some scripts in "stats" directoryPatrick Steinhardt, May 12, 2025
  25. Elijah NewrenMay 13, 2025

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.