Switch git-todo-parser from fsmiamoto original repo to stefanhaller's fork

Sometimes it takes a while to get PRs accepted upstream, and this blocks our
progress. Since I'm pretty much the only one making changes there anyway, it
makes sense to point to my fork directly.
This commit is contained in:
Stefan Haller 2024-04-06 14:45:49 +02:00
parent 69153acfdb
commit 7270dea48d
20 changed files with 20 additions and 21 deletions

View file

@ -0,0 +1,78 @@
package todo
type TodoCommand int
const (
Pick TodoCommand = iota + 1
Revert
Edit
Reword
Fixup
Squash
Exec
Break
Label
Reset
Merge
NoOp
Drop
UpdateRef
Comment
)
type Todo struct {
Command TodoCommand
Commit string
Flag string
Comment string
ExecCommand string
Label string
Msg string
Ref string
}
func (t TodoCommand) String() string {
return commandToString[t]
}
var commandToString = map[TodoCommand]string{
Pick: "pick",
Revert: "revert",
Edit: "edit",
Reword: "reword",
Fixup: "fixup",
Squash: "squash",
Exec: "exec",
Break: "break",
Label: "label",
Reset: "reset",
Merge: "merge",
NoOp: "noop",
Drop: "drop",
UpdateRef: "update-ref",
Comment: "comment",
}
var todoCommandInfo = [15]struct {
nickname string
cmd string
}{
{"", ""}, // dummy value since we're using 1-based indexing
{"p", "pick"},
{"", "revert"},
{"e", "edit"},
{"r", "reword"},
{"f", "fixup"},
{"s", "squash"},
{"x", "exec"},
{"b", "break"},
{"l", "label"},
{"t", "reset"},
{"m", "merge"},
{"", "noop"},
{"d", "drop"},
{"u", "update-ref"},
}