Skip to content

[docker] Suppress git detached HEAD advice#13962

Merged
swoboda1337 merged 2 commits intoesphome:devfrom
swoboda1337:docker-suppress-detached-head-advice
Feb 12, 2026
Merged

[docker] Suppress git detached HEAD advice#13962
swoboda1337 merged 2 commits intoesphome:devfrom
swoboda1337:docker-suppress-detached-head-advice

Conversation

@swoboda1337
Copy link
Member

@swoboda1337 swoboda1337 commented Feb 12, 2026

What does this implement/fix?

Suppress the git "detached HEAD" advice message that appears repeatedly during PlatformIO dependency installation. PlatformIO clones dependencies by checking out specific tags/commits, which triggers this verbose advice for every dependency without providing useful information to the user.

Example of the noise this removes (repeated per dependency):

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:

  git switch -c <new-branch-name>

Or undo this operation with:

  git switch -

Turn off this advice by setting config variable advice.detachedHead to false

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Developer breaking change (an API change that could break external components)
  • Code quality improvements to existing code or addition of tests
  • Other

Related issue or feature (if applicable):

N/A

Pull request in esphome-docs with documentation (if applicable):

N/A — no user-facing configuration changes.

Test Environment

  • ESP32
  • ESP32 IDF
  • ESP8266
  • RP2040
  • BK72xx
  • RTL87xx
  • LN882x
  • nRF52840

Example entry for config.yaml:

# No configuration changes — this is a Docker build improvement.

Checklist:

  • The code change is tested and works locally.
  • Tests have been added to verify that the new code works (under tests/ folder).

If user exposed functionality or configuration variables are added/changed:

PlatformIO clones dependencies by checking out specific tags/commits,
which triggers git's "detached HEAD" advice message for every dependency.
This adds noise to the build output without providing useful information.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@esphome esphome bot added code-quality small-pr PR < 30 lines labels Feb 12, 2026
@swoboda1337 swoboda1337 added this to the 2026.2.0b2 milestone Feb 12, 2026
@swoboda1337 swoboda1337 merged commit 136d173 into esphome:dev Feb 12, 2026
8 checks passed
@swoboda1337
Copy link
Member Author

Thanks

@github-actions github-actions bot locked and limited conversation to collaborators Feb 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants