this post was submitted on 05 Apr 2024
127 points (96.4% liked)

Programming

17350 readers
313 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities [email protected]



founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 1 points 7 months ago (1 children)

Because you'd have to stash your modifications to be able to switch branch. The stash is a stack so very limited in what it can do (just push and pop). You might prefer to commit on a temporary branch instead. But you might also need some parts from your current modifications for the bug fix, at which point having it taken away on another branch or in stash won't do. I would usually end up resorting to doing another checkout side by side anyway, and if I can make it a sparse checkout it's even better.

[–] [email protected] 1 points 7 months ago* (last edited 7 months ago) (1 children)

Because you’d have to stash your modifications to be able to switch branch.

OP said nothing about stashing, only committing WIP commits to feature branches. I don't think none of your remarks apply, because if you really need stuff from the WIP commits you can also cherry-pick them or checkout specific files.

[–] [email protected] 1 points 7 months ago (1 children)

If you find it more comfortable to keep swapping checkouts in the same dir that's cool. I'm just explaining that some of use find it easier to keep several different checkouts around, and sparse checkouts are helpful when you do that.

[–] [email protected] 1 points 7 months ago