Skip to main content

print_commit_summary

Function print_commit_summary 

Source
pub fn print_commit_summary(
    out: &mut impl Write,
    store: &ObjectStore,
    head: &HeadRef<'_>,
    hash: &Hash,
    subject: &str,
    is_root: bool,
    old_tree: Option<Hash>,
    new_tree: Option<Hash>,
)
Expand description

Render git’s post-commit summary on out:

[main (root-commit) 1a2b3c4] subject
 2 files changed, 2 insertions(+)
 create mode 100644 a.txt

old_tree/new_tree bound the diffstat (None = the empty tree, e.g. a root commit). The diffstat + mode trailers are best-effort: a failure to compute them still leaves the [...] headline intact. Object ids are BLAKE3 prefixes (the documented hash-length divergence).