Expand description
Shared ref-filter formatting primitives.
Git reuses the same identity/date/refname formatting language across
for-each-ref, branch, tag, log, show, stash, and status output.
This crate owns those semantic primitives so the CLI can remain an entry
point instead of a home for every command’s formatting state.
Structs§
- ForEach
RefFormat - ForEach
RefMessage Parts - The split of a commit/tag message into the regions git’s for-each-ref atoms
expose, mirroring ref-filter.c
find_subpos. - ForEach
RefStrip - ForEach
RefTrack
Enums§
- ForEach
RefAtom - ForEach
RefAtom Identity Part - ForEach
RefAtom Identity Role - ForEach
RefEmail Mode - ForEach
RefFormat Segment - ForEach
RefName Format - ForEach
RefName Source - ForEach
RefQuote Mode - ForEach
RefStrip Direction
Functions§
- commit_
identity_ date - commit_
identity_ date_ or_ sentinel - Render an ident’s date for the structured header lines (
Date:/AuthorDate:/CommitDate:), mirroring pretty.c’spp_user_info, which callsshow_ident_datedirectly: a missing or unparsable date still prints the epoch sentinel (Thu Jan 1 00:00:00 1970 +0000) rather than an empty string. Use this for the medium/full/fuller layouts; usecommit_identity_datefor the%ad/%cdplaceholders, which suppress a missing date entirely. - for_
each_ ref_ abbrev_ oid - for_
each_ ref_ copy_ subject copy_subject: render the subject with embedded newlines turned into single spaces (CRLF’s CR is dropped), matching ref-filter.c.- for_
each_ ref_ identity_ date - for_
each_ ref_ identity_ date_ raw - for_
each_ ref_ identity_ email - for_
each_ ref_ identity_ name - for_
each_ ref_ identity_ timestamp - for_
each_ ref_ lstrip_ name - for_
each_ ref_ message_ parts - Split a commit/tag message into the for-each-ref content regions, mirroring
ref-filter.c
find_subpos.messageis the header-stripped message (sley already strips object headers before this point). - for_
each_ ref_ rstrip_ name - for_
each_ ref_ sanitize_ subject format_sanitized_subject: replace non-title-character runs with a single-, collapse consecutive., and trim trailing./-(pretty.c).- for_
each_ ref_ short_ name - for_
each_ ref_ track_ short - parse_
for_ each_ ref_ abbrev_ width - parse_
for_ each_ ref_ contents_ lines_ count - parse_
for_ each_ ref_ strip_ count - shorten_
unambiguous_ ref - git’s
shorten_unambiguous_ref: find the shortest abbreviation ofrefnamethat, under the rev-parse rules, resolves back to exactly this ref.strict(git’score.warnambiguousrefs, default true) requires all other rules to fail; otherwise only rules that sort before the matched one matter.ref_existsreports whether a fully-qualified refname is present. - write_
for_ each_ ref_ format - write_
for_ each_ ref_ identity - write_
for_ each_ ref_ identity_ date - write_
for_ each_ ref_ identity_ date_ mode - write_
for_ each_ ref_ identity_ date_ raw - write_
for_ each_ ref_ identity_ email - write_
for_ each_ ref_ identity_ email_ mode - write_
for_ each_ ref_ identity_ name - write_
for_ each_ ref_ quoted_ atom - write_
for_ each_ ref_ track