Skip to content

modules init should suppress raw detached-HEAD advice for pinned modules #50

Description

@junior-ricon

Problem

When modules init checks out an untracked/pinned module at an exact commit, Git emits the full detached-HEAD advice block:

Note: switching to '<sha>'.

You are in 'detached HEAD' state...
...
HEAD is now at <sha> <subject>

This is technically accurate, but it is noisy and alarming during normal agent-home / desk preparation. The modules tool already prints its own status line, so raw Git advice leaks an implementation detail into the operator-facing setup path.

Desired behavior

modules init should keep its output concise and owned by modules, e.g.:

  den: pinned <sha>
  fold: tracking main @ <sha>

For pinned detached checkouts, suppress Git's detached-HEAD advice (or use a quieter checkout path) while still failing loudly on real checkout errors.

Context

This surfaced while preparing a fresh desk-scoped junior home. The root cause for junior was fixed separately by marking den and fold as tracking main, but pinned modules remain a valid manifest shape and should not dump raw Git guidance during successful initialization.

Acceptance criteria

  • Successful pinned-commit checkout does not print Git's detached-HEAD advice block.
  • Real clone/checkout errors remain visible and nonzero.
  • Tests cover pinned detached checkout output and tracked-branch checkout output.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions