Logbook auto: keep the empty body field of a commit with no description
This commit is contained in:
1 parent
f1241c19a3
commit
9eee1294e0
1 file changed
+2
-1
@@ -61,7 +61,8 @@ def _kind(files):
|
||||
def log_commits(project, repo, since, head):
|
||||
"""One ship's log entry per commit on main after `since` (oldest first); a summary when there are many."""
|
||||
raw = _git(repo, "log", "--reverse", "--no-merges", "--format=%H%x1f%cI%x1f%s%x1f%b%x1e", f"{since}..{head}")
|
||||
commits = [c.strip().split("\x1f") for c in raw.split("\x1e") if c.strip()]
|
||||
# str.strip() counts \x1f as whitespace and would eat an empty body's field, so trim newlines only and pad
|
||||
commits = [(c.strip("\r\n").split("\x1f") + [""] * 4)[:4] for c in raw.split("\x1e") if c.strip("\r\n")]
|
||||
added = []
|
||||
if len(commits) > MAX_ENTRIES:
|
||||
subjects = "\n".join(f"- {c[2]} ({c[0][:8]})" for c in commits[-40:])
|
||||
|
||||
Reference in new issue
Block a user