Skip to main content

Module git

Module git 

Source
Expand description

Best-effort git plumbing for recording the commit that closes an issue.

A commit cannot contain its own hash: its hash is derived from its tree and its message, so a ticket can never store the hash of the very commit that writes it. tix therefore records either the work commit that was already made (auto-captured from HEAD when a ticket is closed) or, after the closure commit lands, resolves the commit that last touched the issue file. Both are best-effort: a missing git, a non-repository directory, or an uncommitted file yields None and never an error.

Functionsยง

current_head
The current HEAD commit hash, best-effort.
last_commit_for_path
The most recent commit that touched path, best-effort.
resolve_closing_commit
The hash to record for automatic resolution (--commit auto): the commit that last touched the issue file, falling back to HEAD.