feat: suppress detached head message
Metadata
Current evaluation
Merged PR #1358 as commit 4cddc2ec, adding advice.detachedHead=false to Git clone commands and tests to suppress verbose detached-HEAD output.
Resolution: closed resolved
Reason: PR #1358 was merged into craft-parts as commit 4cddc2ec. It disables Git's detached-HEAD advice during source cloning and adds corresponding tests and changelog coverage.
Evaluated by: mr-cal-bot
No scores available.
Issue body
- [x] Have you followed the guidelines for contributing?
- [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
- [x] Have you successfully run `make lint && make test`?
- [x] Have you added an entry to the changelog (`docs/reference/changelog.rst`)?
---
when cloning a git source the logs are overly verbose:
```
2025-10-08 10:21:24.717 :: Cloning into '/root/parts/go-github-juju-fslock/src'...
2025-10-08 10:21:25.607 :: From https://github.com/juju/fslock
2025-10-08 10:21:25.607 :: * branch 4d5c94c67b4b207e1ab4ebca6b4e47f174618b86 -> FETCH_HEAD
2025-10-08 10:21:25.619 Executing: /snap/sourcecraft/712/libexec/sourcecraft/craft.git -C /root/parts/go-github-juju-fslock/src checkout 4d5c94c67b4b207e1ab4ebca6b4e47f174618b86
2025-10-08 10:21:25.623 :: Note: switching to '4d5c94c67b4b207e1ab4ebca6b4e47f174618b86'.
2025-10-08 10:21:25.623 ::
2025-10-08 10:21:25.623 :: You are in 'detached HEAD' state. You can look around, make experimental
2025-10-08 10:21:25.623 :: changes and commit them, and you can discard any commits you make in this
2025-10-08 10:21:25.623 :: state without impacting any branches by switching back to a branch.
2025-10-08 10:21:25.623 ::
2025-10-08 10:21:25.623 :: If you want to create a new branch to retain commits you create, you may
2025-10-08 10:21:25.623 :: do so (now or later) by using -c with the switch command. Example:
2025-10-08 10:21:25.623 ::
2025-10-08 10:21:25.623 :: git switch -c <new-branch-name>
2025-10-08 10:21:25.624 ::
2025-10-08 10:21:25.624 :: Or undo this operation with:
2025-10-08 10:21:25.624 ::
2025-10-08 10:21:25.624 :: git switch -
2025-10-08 10:21:25.624 ::
2025-10-08 10:21:25.624 :: Turn off this advice by setting config variable advice.detachedHead to false
2025-10-08 10:21:25.624 ::
2025-10-08 10:21:25.625 :: HEAD is now at 4d5c94c change readme
```
This PR suppresses that message
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #1358 as commit 4cddc2ec, adding advice.detachedHead=false to Git clone commands and tests to suppress verbose detached-HEAD output. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged #1358 in commit 4cddc2ec, suppressing Git's verbose detached-HEAD advice during source checkouts. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #1358 in commit 4cddc2ec, suppressing Git's verbose detached-HEAD advice when checking out source commits during clones. | |
| qwen/qwen3.6-35b-a3b | — | — | Merged after three approvals and passing all CI checks. The change suppresses verbose detached HEAD git checkout messages during source cloning. Three files were modified (+65/-6 lines). Unrelated CI failures were discussed but did not block the merge. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged to suppress verbose detached HEAD git messages during source cloning, reducing log noise. Unrelated CI failures and chisel retry discussions were noted but did not affect the merge. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #2564 remote_build: handle git push in detached head state | snapcraft | merged | Merged PR #2564 (commit 41c7adaf9), fixing remote builds from detached HEAD by using HEAD when Git branch lookup fails. |