git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* feature request: add [-f|--from <rootbranch>] to git stash branch
@ 2022-01-13 16:29 Colin Kennedy
  2022-01-14 14:53 ` Philip Oakley
  0 siblings, 1 reply; 3+ messages in thread
From: Colin Kennedy @ 2022-01-13 16:29 UTC (permalink / raw)
  To: git

Current syntax of git stash branch is:

branch <branchname> [<stash>]

Proposed syntax is:

branch <branchname> [-f|--from <rootbranch>] [<stash>]

the from flag specifies a branch from which the new branch should be derived.

Example usage:

git stash branch remove-commented-code --from main

This simplifies a workflow which is common for me. I am working N-commits deep in some feature branch when I discover a low hanging fruit. Dealing with this low hanging fruit is not appropriate for the current feature branch. It's most appropriate to deal with "directly" on a fresh branch from main. Because I am untidy, I often have a bit of mess in between my staging area, and unstaged changes, and this creates friction when I attempt to stash this low hanging fruit, pop back to main, create the new branch, pop the stashed low hanging fruit, etc etc.

The proposed flag gives a one-liner to apply stashed patches wherever, no matter your current location, which I think is an improvement.

Happy to have feedback on the flag. Happy for someone else to implement it. Also happy to consider taking a crack at it myself if it seems like something people would be happy to include. (NB: I haven't written or even read any c, or c++ for that matter, in probably 15 years. So, you know).

thanks,
Colin

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-01-14 19:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-13 16:29 feature request: add [-f|--from <rootbranch>] to git stash branch Colin Kennedy
2022-01-14 14:53 ` Philip Oakley
2022-01-14 19:02   ` Junio C Hamano

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).