git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Thomas Lowry" <thomas@bit-artificer.com>
To: <git@vger.kernel.org>
Subject: Expanded worktree tooling?
Date: Fri, 15 Mar 2024 17:53:59 +1030	[thread overview]
Message-ID: <CZU56XWOUT4P.1WZ2BSE0VLN01@bit-artificer.com> (raw)

Hello,

I recently learned about worktrees in git and I was wondering if some
extra tooling could benefit workflows that lean on it?

These are the use cases I have banging around in my head:
- throwaway/temp workspaces
  One use case that I've seen alot is creating a workspace to handle
  some hotfix and/or debugging and possibly commit the fix. Instead of
  needing to actively manage this workspace (mostly the cleanup) I
  imagine it would not be too dificult to these in the /tmp folder and
  then cleanup/ignore their entries. Temp workspace file paths might
  make this kind of tooling pointless unless you also automatically
  change the working directory to the new workspace.. I've seen people
  advocate for a git aliases that jump between workspaces but if your
  adding the workspace and typing out the file path anyways then
  `cd path` is shorter than an alias anyways.
- move hunks between workspaces
  In my experience it's more common for a hotfix/debugging use case to
  get the report and just use the current branch since it's not often
  that your current branch is either completely broken or directly
  conflicts with the reported bug. I usually don't stashing and changing
  branches until I've got a fix and want to commit it. I recently tried
  a workspace for this situation but I ended needing to retype the fix
  in the new workspace, after reflecting a bit I should be able to do 
  `git stash -p` in the main workspace then `git stash pop` in the new
  worktree but a dedicated way to move hunks would be quite useful.

I think there could be more opportunities for general use cases to
benefit from workspaces if there were extra workspace tooling but these
are the only ones I can think of, also to be clear I'm not really
considering any tooling that would allow workspaces to do something you
can't already do with git in some other way.

Thoughts?

Regards,
Thomas


             reply	other threads:[~2024-03-15  7:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-15  7:23 Thomas Lowry [this message]
2024-03-15 19:12 ` Expanded worktree tooling? Kristoffer Haugsbakk
2024-04-02  7:03 ` Thomas Lowry

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=CZU56XWOUT4P.1WZ2BSE0VLN01@bit-artificer.com \
    --to=thomas@bit-artificer.com \
    --cc=git@vger.kernel.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).