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/loop/server/loophttp.go b/loop/server/loophttp.go
index b186760..a89557d 100644
--- a/loop/server/loophttp.go
+++ b/loop/server/loophttp.go
@@ -1112,12 +1112,13 @@
totalUsage := s.agent.TotalUsage()
return State{
- StateVersion: 2,
- MessageCount: serverMessageCount,
- TotalUsage: &totalUsage,
- Hostname: s.hostname,
- WorkingDir: getWorkingDir(),
- InitialCommit: s.agent.InitialCommit(),
+ StateVersion: 2,
+ MessageCount: serverMessageCount,
+ TotalUsage: &totalUsage,
+ Hostname: s.hostname,
+ WorkingDir: getWorkingDir(),
+ // TODO: Rename this field to sketch-base?
+ InitialCommit: s.agent.SketchGitBase(),
Title: s.agent.Title(),
BranchName: s.agent.BranchName(),
OS: s.agent.OS(),