Add a "Mark commit as base commit for rebase" command

This allows to do the equivalent of "git rebase --onto <target> <base>", by
first marking the <base> commit with the new command, and then selecting the
target branch and invoking the usual rebase command there.
This commit is contained in:
Stefan Haller
2023-06-11 08:08:55 +02:00
parent 375451785c
commit 66de981e91
24 changed files with 237 additions and 10 deletions

View File

@@ -0,0 +1,25 @@
package marked_base_commit
type MarkedBaseCommit struct {
sha string // the sha of the commit used as a rebase base commit; empty string when unset
}
func New() MarkedBaseCommit {
return MarkedBaseCommit{}
}
func (m *MarkedBaseCommit) Active() bool {
return m.sha != ""
}
func (m *MarkedBaseCommit) Reset() {
m.sha = ""
}
func (m *MarkedBaseCommit) SetSha(sha string) {
m.sha = sha
}
func (m *MarkedBaseCommit) GetSha() string {
return m.sha
}