Skip to content

fix(crafter): resolve commit info in git worktrees#3020

Merged
jiparis merged 1 commit intochainloop-dev:mainfrom
jiparis:jiparis/fix-crafter-issue-3018
Apr 10, 2026
Merged

fix(crafter): resolve commit info in git worktrees#3020
jiparis merged 1 commit intochainloop-dev:mainfrom
jiparis:jiparis/fix-crafter-issue-3018

Conversation

@jiparis
Copy link
Copy Markdown
Member

@jiparis jiparis commented Apr 9, 2026

Summary

  • Enable EnableDotGitCommonDir in go-git's PlainOpenOptions so that git worktrees can properly resolve HEAD via .git/commondir
  • Previously, running chainloop att init from a worktree returned no commit info because go-git couldn't follow the commondir reference to resolve HEAD
[in a worktree ...]
./chainloop att init --workflow mywf --project myproject --replace
WRN User-attended mode detected. This is intended for local testing only. For CI/CD or automated workflows, please use an API token.
This command will run against the organization "silly-greider-943"
Please confirm to continue y/N
y
INF discovered AI agent config files agent=claude files=7
INF uploading ai-agent-config-claude-3750200425.json - sha256:6b3ef54d6edfada4b2b1e5294c8946b7842a258af960008b42d5fc591c0038e8
INF successfully collected AI agent configuration agent=claude
INF Attestation initialized! now you can check its status or add materials to it
┌───────────────────────────┬──────────────────────────────────────┐
│ Initialized At            │ 09 Apr 26 21:47 UTC                  │
├───────────────────────────┼──────────────────────────────────────┤
│ Attestation ID            │ 9cf70434-5352-492e-b12e-6a6b79c894cd │
│ Organization              │ silly-greider-943                    │
│ Name                      │ mywf                                 │
│ Project                   │ myproject                            │
│ Version                   │ v1.89.11+next (prerelease)           │
│ Contract                  │ myproject-mywf (revision 4)          │
│ Timestamp Authority       │ http://timestamp.digicert.com        │
│ Policy violation strategy │ ADVISORY                             │
│ Policies                  │ ------                               │
│                           │ source-commit: Ok                    │
└───────────────────────────┴──────────────────────────────────────┘

Closes #3018

@jiparis jiparis requested a review from a team April 9, 2026 21:42
Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Enable EnableDotGitCommonDir in go-git PlainOpenOptions so that
worktree directories can properly resolve HEAD via .git/commondir.

Closes chainloop-dev#3018

Signed-off-by: Jose I. Paris <jiparis@chainloop.dev>
@jiparis jiparis force-pushed the jiparis/fix-crafter-issue-3018 branch from 60a51c9 to 1aed8ce Compare April 9, 2026 21:51
Copy link
Copy Markdown
Member

@migmartri migmartri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this related to this upgrade? #2966

@jiparis
Copy link
Copy Markdown
Member Author

jiparis commented Apr 10, 2026

Is this related to this upgrade? #2966

Probably not. It was a missing configuration in the library.

@jiparis jiparis merged commit 26c2d62 into chainloop-dev:main Apr 10, 2026
14 checks passed
@jiparis jiparis deleted the jiparis/fix-crafter-issue-3018 branch April 10, 2026 07:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: commit info not provided in worktrees

3 participants