agent: move "sketch-base" into git
The agent's notion of "initial commit" is kind of special, in that it
is used as the "base" for a bunch of git operations. It's hard for
the user to change (we only provide a workflow via restart), yet
sometimes you want to do just that.
So, instead we put it as data inside of it, named as a tag sketch-base.
It's abusing tags, but branches are no better.
diff --git a/termui/termui.go b/termui/termui.go
index 1575473..6dc5f87 100644
--- a/termui/termui.go
+++ b/termui/termui.go
@@ -262,10 +262,11 @@
branches = append(branches, branch)
}
- initialCommitRef := getShortSHA(ui.agent.InitialCommit())
+ initialCommitRef := getShortSHA(ui.agent.SketchGitBase())
if len(branches) == 1 {
ui.AppendSystemMessage("\nš Branch pushed during session: %s", branches[0])
ui.AppendSystemMessage("š To add those changes to your branch: git cherry-pick %s..%s", initialCommitRef, branches[0])
+ ui.AppendSystemMessage("š or git merge %s", branches[0])
} else {
ui.AppendSystemMessage("\nš Branches pushed during session:")
for _, branch := range branches {
@@ -275,6 +276,14 @@
for _, branch := range branches {
ui.AppendSystemMessage("git cherry-pick %s..%s", initialCommitRef, branch)
}
+ ui.AppendSystemMessage("\nš To add all those changes to your branch:")
+ for _, branch := range branches {
+ ui.AppendSystemMessage("git cherry-pick %s..%s", initialCommitRef, branch)
+ }
+ ui.AppendSystemMessage("\nš or:")
+ for _, branch := range branches {
+ ui.AppendSystemMessage("git merge %s", branch)
+ }
}
}
ui.mu.Unlock()