RFC-822-style header behavior enhancements
The RFC-822-style headers prepended to the commit comment by src fast-import
to preserve metadata not otherwise representable in SRC cause problems for src list
and src log
, and are underutilized, when present. This series fixes the problems and takes advantage of the headers to enhance existing operations. Specifically:
-
src list
displays the first line of the commit comment, which is typically a summary of changes, however, headers are prepended byfast-import
, which makessrc list
uselessly display theAuthor:
header unconditionally:% src list example.txt = example.txt ========== 2 * <date> Author: Theodore Geisel <cat@hat.com> 1 - <date> Author: Theodore Geisel <cat@hat.com>
This series restores the expected behavior of showing the commit comment summary line.
-
src log
output is overly noisy when headers are present; this series suppresses display of the headers by default and teachessrc log
a-v
option to re-enable them. -
SRC tracks only a single date, the so-called commit date, which
src list
andsrc log
display. However, for histories imported viasrc fast-import
, it is not uncommon for many commits to share the same commit date.This situation can arise easily, for instance, when a project maintainer bulk-applies a series of patches (with, say,
git am patches.mbox
), in which case most or all commits will have the same commit timestamp. Likewise, in Git, rebasing can set the committer timestamp of many commits to the same value. For example, givengit rebase -i HEAD~50
, after commitHEAD~50
is edited, the committer timestamp of the remaining 49 commits will likely have the same value when replayed atopHEAD~50
.For this reason, committer date is not typically considered interesting, and tools prefer to instead show author date, by default. For instance,
git log --format=short
,... -format=medium
, andgitk
all default to showing the author, rather than the committer date. This series changessrc list
andsrc log
to follow suit, showing the author date, rather than committer, if the author date is available in the RFC-822-style headers. (For commits made directly in SRC, those headers are not present, so commit date is shown as usual.) -
Improve
src fast-import
/src fast-export
roundtrip fidelity by taking advantage of author and committer information and timestamps in the RFC-822-style headers, if present, rather than using only the commit date and unconditionally assigning the person runningfast-export
as both the author and committer.