Open FND opened 13 years ago
so it's basically a cherry-pick in reverse? punting it at the target branch? sounds good to me
so it's basically a cherry-pick in reverse?
Exactly. However, turns out the above script doesn't work reliably; seems like the last line's rebase
call is not passed the grep
-filtered output, so nothing actually changes. Needs investigation...
I like the idea though, when I have a chance I'll whip something up
maybe git punt sha1 to branch
to
being optional because it sounds cool :D haha
punt
seems like a good name.
However, perhaps this whole thing not such a good idea after all, as it kinda encourages rebasing (which should generally be avoided, unless you really know what you're doing - and it's not even explicit here).
Maybe this should at least accept multiple commit hashes, thus encouraging users to only do only a single, conscious punt/rebase? (This would also mean not just automatically passing it through grep
; perhaps use sed
to prefix the respective lines and then pass it to $EDITOR
as usual?)
FWIW, I managed to fix the aforementioned (original) issue by using sed
:
GIT_EDITOR="sed -i /.*${treeish:0:7}.*/d" git rebase -p -i "${treeish}~2"
While working on a feature branch, I often come across and fix various minor issues (e.g. code readability). Ideally such commits should live on a separate branch to avoid obscuring feature changes.
Based on IRC conversations (#git on FreeNode), here's what I came up with (tentatively called
git-flick
, for lack of inspiration):(This is not extensively tested yet.)
If this is deemed of general interest, I could submit a pull request.