Hacker News new | ask | show | jobs
by petre 3530 days ago
Why would I commit my breaking, work in progress experiments to a branch? Isn't that what stashes are for?
3 comments

New branch flagged as a "stash", named related to the branch it came from. So branch myFeature has stash myFeature-stash-1 stash branch. Hide stash branches from branch lists unless specifically requested.

Do the same with stash commits. Store them as regular commits flagged as broken and hide them when viewing history.

Hell, do the same for most history-modifying operations. The ability to flag intermediate commits as "unimportant" would let you be able to keep a clean history without rewriting it.

Maybe you want to push your work to a remote server as a way to back it up.

Maybe you want to share your work with others even though it's still in a rough state.

Maybe you have automated tests in your CI process and you want to try those tests on your side-branch.

The point is you might want to wrap workflow around your stuff, even if it's experimental and broken.

Git doesn't make these choices for you. You get to make them.

Because sometimes stashes are longer lived than we expect, and they're hard to work with if you need to do anything more complicated than popping. (Like resolving conflicts.)

I find that making a work-in-progress commit, and then resetting later ends up saving a lot of hassle overall. Having support for this beyond aliases (including putting that commit in a new branch) would be nice.

Okay, points taken. But git enables me to commit expermiments to a branch anyway if I decide to. Gitless' lack of stash would force me to commit experiments to a branch.