Skip to content

The identity hook refuses read-only git commands whose names hold a write verb #77

Closed

Description

@don-petry

Part of the epic "Epic: slice 0, foundations. The repo holds the line, its context is tested, and the platform facts are recorded".

Why. The identity hook from "Session hooks that check" (#66) refused git merge-tree --write-tree --name-only A B with git_command_unknown. merge-tree is a read-only plumbing command, but the text names "merge", and the hook does not know the command. Other read-only commands are likely refused the same way: merge-base, commit-graph, rev-list, ls-tree, cat-file and for-each-ref. Each refusal sends a session to a workaround, and a hook people work around is weaker.

Done when

  • The hook knows git's read-only commands by name (at least merge-base, merge-tree without --write-tree side effects on refs, rev-parse, rev-list, ls-tree, ls-files, cat-file, show, log, diff, for-each-ref, name-rev, describe, archive, fetch) and lets them pass. A test runs each.
  • A write verb hidden in an argument of a read-only command (git log --grep=commit) does not refuse.
  • An unknown command or alias is still refused.

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