Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
d85db30
feat(zerogit): auto-create a conventional branch before push/pr on de…
euxaristia Jul 14, 2026
a4bfe37
fix(zerogit): normalize LLM branch slugs, bound remote lookup, handle…
euxaristia Jul 14, 2026
0687439
fix(zerogit,cli): make auto-branching collision-safe, remote-aware, f…
euxaristia Jul 15, 2026
e8f04dc
style(zerogit): align fake-runner result comments to gofmt output
euxaristia Jul 15, 2026
85eb9a0
test(zerogit): cover Push's fail-closed path when the default branch …
euxaristia Jul 15, 2026
44ae643
fix(zerogit): keep a stale cached remote HEAD from clearing the push …
euxaristia Jul 16, 2026
30c9028
fix(cli): honor --diff-bytes when inspecting the diff for auto-branch…
euxaristia Jul 16, 2026
7fd02e0
fix(cli): refuse an auto-branch push when HEAD has nothing to publish
euxaristia Jul 16, 2026
8837421
fix(cli): recover the branch slug from preamble or fenced LLM replies
euxaristia Jul 16, 2026
ea34bf2
fix(zerogit): harden auto-branch remote handling
euxaristia Jul 18, 2026
5c06213
fix(zerogit): close branch-naming and push safety gaps from review
euxaristia Jul 19, 2026
5c400d1
fix(cli): require a clean tree before auto-branch push/pr
euxaristia Jul 19, 2026
98c28f0
fix(zerogit): drop fixed five-second remote lookup timeout
euxaristia Jul 20, 2026
857c2d9
fix(cli): bypass the ahead-count and diff-base checks on a confirmed-…
euxaristia Jul 22, 2026
21215eb
fix(zerogit): resolve main/master against the live remote default first
euxaristia Jul 22, 2026
67453d0
fix(cli): preserve push lease on retry and check the live default ref
euxaristia Jul 22, 2026
59dbf6c
fix(cli): track generated branches, reject PR on unborn remote, class…
euxaristia Jul 23, 2026
f152914
fix(zerogit,cli): preserve explicit nonexistence lease on force, prop…
euxaristia Jul 24, 2026
597ef74
fix(zerogit): preserve non-existence lease on target remote and roll …
euxaristia Jul 31, 2026
68bf72d
fix(cli): address review findings for auto feature branch creation
euxaristia Jul 31, 2026
c5f42e5
fix(cli): refine LLM preamble candidate slug extraction and enforce u…
euxaristia Jul 31, 2026
84625bc
fix(cli): restore default branch after auto-branch and resolve --yes …
euxaristia Aug 1, 2026
dcbd0ee
test(cli): assert auto-branch passes capped diff into the provider
euxaristia Aug 1, 2026
111c926
fix(cli): block auto-branch on unborn remotes and fix lease/restore
euxaristia Aug 1, 2026
27a638f
fix(cli): recover push -u upstream and filter LLM slug preambles
euxaristia Aug 1, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 113 additions & 5 deletions internal/cli/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,22 @@ type appDeps struct {
commitChanges func(context.Context, zerogit.CommitOptions) (zerogit.CommitResult, error)
pushChanges func(context.Context, zerogit.PushOptions) (zerogit.PushResult, error)
createPR func(context.Context, zerogit.PROptions) (zerogit.PRResult, error)
createBranch func(context.Context, zerogit.BranchOptions) (zerogit.BranchResult, error)
isDefaultBranch func(context.Context, zerogit.DefaultBranchOptions) (bool, string, string, error)
currentGitUser func(context.Context, string) string
headCommitSubject func(context.Context, string) string
commitsAhead func(context.Context, string, string, string) (int, error)
isUnbornRemote func(context.Context, string, string) (bool, error)
refreshTrackingRef func(context.Context, string, string, string) error
branchHasUpstream func(context.Context, string, string) (bool, error)
branchUpstreamRemote func(context.Context, string, string) string
branchUpstreamRef func(context.Context, string, string) string
remoteHasBranch func(context.Context, string, string, string) (bool, error)
currentGitBranch func(context.Context, string) string
deleteBranch func(context.Context, string, string, string) error
resetBranchRef func(context.Context, string, string, string) error
markGeneratedBranch func(context.Context, string, string) error
isGeneratedBranch func(context.Context, string, string) bool
runTUI func(context.Context, tui.Options) int
runEditor func(string) error
checkUpdate func(context.Context, update.Options) (update.Result, error)
Expand Down Expand Up @@ -195,11 +211,55 @@ func defaultAppDeps() appDeps {
commitChanges: zerogit.Commit,
pushChanges: zerogit.Push,
createPR: zerogit.CreatePR,
runTUI: tui.Run,
runEditor: openEditor,
checkUpdate: update.Check,
applyUpdate: update.Apply,
now: time.Now,
createBranch: zerogit.CreateBranch,
isDefaultBranch: zerogit.IsDefaultBranch,
currentGitUser: func(ctx context.Context, cwd string) string {
return zerogit.CurrentGitUser(ctx, cwd, nil)
},
headCommitSubject: func(ctx context.Context, cwd string) string {
return zerogit.HeadCommitSubject(ctx, cwd, nil)
},
commitsAhead: func(ctx context.Context, cwd, remote, branch string) (int, error) {
return zerogit.CommitsAhead(ctx, cwd, remote, branch, nil)
},
isUnbornRemote: func(ctx context.Context, cwd, remote string) (bool, error) {
return zerogit.IsUnbornRemote(ctx, cwd, remote, nil)
},
refreshTrackingRef: func(ctx context.Context, cwd, remote, branch string) error {
return zerogit.RefreshTrackingRef(ctx, cwd, remote, branch, nil)
},
branchHasUpstream: func(ctx context.Context, cwd, branch string) (bool, error) {
return zerogit.HasUpstream(ctx, cwd, branch, nil)
},
branchUpstreamRemote: func(ctx context.Context, cwd, branch string) string {
return zerogit.UpstreamRemote(ctx, cwd, branch, nil)
},
branchUpstreamRef: func(ctx context.Context, cwd, branch string) string {
return zerogit.UpstreamRef(ctx, cwd, branch, nil)
},
remoteHasBranch: func(ctx context.Context, cwd, remote, branch string) (bool, error) {
return zerogit.RemoteHasBranch(ctx, cwd, remote, branch, nil)
},
currentGitBranch: func(ctx context.Context, cwd string) string {
return zerogit.CurrentBranch(ctx, cwd, nil)
},
deleteBranch: func(ctx context.Context, cwd, fallbackBranch, branchToDelete string) error {
return zerogit.DeleteBranch(ctx, cwd, fallbackBranch, branchToDelete, nil)
},
resetBranchRef: func(ctx context.Context, cwd, branch, newTip string) error {
return zerogit.ResetBranchRef(ctx, cwd, branch, newTip, nil)
},
markGeneratedBranch: func(ctx context.Context, cwd, branch string) error {
return zerogit.MarkGeneratedBranch(ctx, cwd, branch, nil)
},
isGeneratedBranch: func(ctx context.Context, cwd, branch string) bool {
return zerogit.IsGeneratedBranch(ctx, cwd, branch, nil)
},
runTUI: tui.Run,
runEditor: openEditor,
checkUpdate: update.Check,
applyUpdate: update.Apply,
now: time.Now,
}
}

Expand Down Expand Up @@ -556,6 +616,54 @@ func fillAppDeps(deps appDeps) appDeps {
if deps.createPR == nil {
deps.createPR = defaults.createPR
}
if deps.createBranch == nil {
deps.createBranch = defaults.createBranch
}
if deps.isDefaultBranch == nil {
deps.isDefaultBranch = defaults.isDefaultBranch
}
if deps.currentGitUser == nil {
deps.currentGitUser = defaults.currentGitUser
}
if deps.headCommitSubject == nil {
deps.headCommitSubject = defaults.headCommitSubject
}
if deps.commitsAhead == nil {
deps.commitsAhead = defaults.commitsAhead
}
if deps.isUnbornRemote == nil {
deps.isUnbornRemote = defaults.isUnbornRemote
}
if deps.refreshTrackingRef == nil {
deps.refreshTrackingRef = defaults.refreshTrackingRef
}
if deps.branchHasUpstream == nil {
deps.branchHasUpstream = defaults.branchHasUpstream
}
if deps.branchUpstreamRemote == nil {
deps.branchUpstreamRemote = defaults.branchUpstreamRemote
}
if deps.branchUpstreamRef == nil {
deps.branchUpstreamRef = defaults.branchUpstreamRef
}
if deps.remoteHasBranch == nil {
deps.remoteHasBranch = defaults.remoteHasBranch
}
if deps.currentGitBranch == nil {
deps.currentGitBranch = defaults.currentGitBranch
}
// deleteBranch and resetBranchRef stay nil when unset so unit tests that
// mock createBranch without a real git tree do not hit real restore/delete.
if deps.markGeneratedBranch == nil {
if deps.createBranch != nil {
deps.markGeneratedBranch = func(context.Context, string, string) error { return nil }
} else {
deps.markGeneratedBranch = defaults.markGeneratedBranch
}
}
if deps.isGeneratedBranch == nil {
deps.isGeneratedBranch = defaults.isGeneratedBranch
}
if deps.runTUI == nil {
deps.runTUI = defaults.runTUI
}
Expand Down
Loading
Loading