Repository navigation
Conductor Quick Start gstack template fails when generated repo has unborn HEAD #1176
Description
Summary
Conductor Quick Start can fail when creating a new project from the gstack template because the setup/build path assumes git rev-parse HEAD works. In a brand-new generated repo before the first commit exists, HEAD is unborn, so git rev-parse HEAD exits 128 and the template setup aborts.
This is separate from the public garrytan/gstack repository itself: the upstream repo has a valid main HEAD. The failure is triggered by the generated Conductor workspace state during bootstrapping.
Observed Error
From Conductor while creating a new Quick Start project named test at /Users/jonas/conductor/repos with the gstack template:
Installing gstack...
error: script "build" exited with code 128
'git <command> [<revision>...] -- [<file>...]'
Use '--' to separate paths from revisions, like this:
fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Node server bundle ready: /Users/jonas/conductor/repos/test/.claude/skills/gstack/browse/dist/server-node.mjs
Likely Setup Path
Current main appears to route Conductor setup like this:
conductor.jsonrunsbin/dev-setupbin/dev-setupcreates.claude/skills/gstack -> repo rootbin/dev-setupcalls.claude/skills/gstack/setupsetuprunsbun run buildwhen compiled browse output is missing or stalepackage.jsonwritesgit rev-parse HEADinto these version files:browse/dist/.versiondesign/dist/.versionmake-pdf/dist/.version
The hard failure is here in the build script:
"build": "... && git rev-parse HEAD > browse/dist/.version && git rev-parse HEAD > design/dist/.version && git rev-parse HEAD > make-pdf/dist/.version && ..."Reproduction Mechanism
I reproduced the same Git failure mode locally by creating a new parent Git repo with no commits, then placing a gstack copy under .claude/skills/gstack without its own .git metadata. From inside that directory:
git rev-parse HEADreturns:
fatal: ambiguous argument 'HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
That matches the Conductor screenshot error and explains why a normal git clone of garrytan/gstack does not reproduce the issue: a normal clone has a resolved HEAD, while Conductor's generated repo can be in an unborn-HEAD state before the initial commit.
Suggested Fix
Make the build version fallback tolerate unborn Git repos. For example, centralize the version resolution once and write the fallback to all version files:
GSTACK_BUILD_VERSION="$(git rev-parse HEAD 2>/dev/null || printf unknown)"
printf '%s\n' "$GSTACK_BUILD_VERSION" > browse/dist/.version
printf '%s\n' "$GSTACK_BUILD_VERSION" > design/dist/.version
printf '%s\n' "$GSTACK_BUILD_VERSION" > make-pdf/dist/.versionOr inline the same fallback in package.json if keeping the build script single-line is preferred:
(git rev-parse HEAD 2>/dev/null || echo unknown) > browse/dist/.version
(git rev-parse HEAD 2>/dev/null || echo unknown) > design/dist/.version
(git rev-parse HEAD 2>/dev/null || echo unknown) > make-pdf/dist/.versionThis should preserve normal cloned-repo behavior while allowing Conductor/new-repo bootstrapping before the first commit exists.
Workaround
Before setup runs, create an initial commit in the generated workspace:
git add -A
git commit -m "Initial commit"
bin/dev-setupIf there is nothing to commit, an empty commit should be enough to create HEAD:
git commit --allow-empty -m "Initialize workspace"
bin/dev-setup
Activity
JonasFocus commentedon Apr 24, 2026
I opened a PR for this here: #1177
I also confirmed the diagnosis locally through Conductor.
A temporary local workaround was to put a narrow
gitshim earlier in Conductor's PATH that only changes this one case:When Git reports an unborn
HEADinside a work tree, the shim returnsunknowninstead of exiting128. With that workaround in place, Conductor's GStack Quick Start completed successfully.That confirms the root issue: the GStack build currently treats missing
HEADas fatal while Conductor may still be creating a brand-new repo before its first commit exists.The PR moves version writing into
scripts/write-build-version.shand uses:VERSION="$(git rev-parse --verify HEAD 2>/dev/null || printf unknown)"I verified the PR without the local workaround in PATH:
bun run buildpasses in a fresh Git repo with no commits.versionfiles are written asunknownin the unborn-HEAD casetime-attack commentedon Jul 15, 2026
@16francej Please close this issue as resolved. The build helper introduced in #1594 safely handles a brand-new repository with no first commit, so the Conductor quick-start build no longer aborts on Git metadata.
capy-ai commentedon Oct 2, 2026
Verified fixed on main (v1.91.12.0):
scripts/write-version-files.shtolerates an unborn HEAD and writes an empty version instead of failing, so the Conductor quick-start build succeeds in a brand-new repo. Shipped in v1.64.0.0 (#2571, absorbing #1594). Thanks! Reply here if you still see the failure and we'll reopen.