From 36a954ef72f119793bbbbc419428a2716cd3464e Mon Sep 17 00:00:00 2001 From: Martin Fischer Date: Sat, 10 Oct 2026 10:59:30 +0200 Subject: tweak(user): show diff when writing commit messages --- user/git/config | 3 +++ user/jj/config.toml | 15 +++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/user/git/config b/user/git/config index f779a68..876ba4f 100644 --- a/user/git/config +++ b/user/git/config @@ -9,5 +9,8 @@ l = log --pretty='%an %ad %h %s %C(auto)%d' --date=format:'%a %d.%m.%Y %R' -- [branch] sort = -committerdate +[commit] +verbose = true + [push] autoSetupRemote = true diff --git a/user/jj/config.toml b/user/jj/config.toml index 68b1018..ece289e 100644 --- a/user/jj/config.toml +++ b/user/jj/config.toml @@ -12,6 +12,21 @@ l = ["log", "-T", "my_log_oneline", "-r", "..@"] ll = ["log", "-T", "builtin_log_compact_full_description", "-r", "..@"] grep = ["util", "exec", "--", "rg", "--no-require-git", "--no-heading", "--no-line-number", "--sort=path"] +[templates] +# Show diff when writing commit messages. +draft_commit_description = ''' +concat( + description, + surround( + "\nJJ: This commit contains the following changes:\n", "", + indent("JJ: ", diff.summary()), + ), + "\n", + "JJ: ignore-rest\n", + diff.git(), +) +''' + [template-aliases] # The default shows seconds which I don't care about. 'format_timestamp(timestamp)' = 'timestamp.local().format("%Y-%m-%d %H:%M")' -- cgit v1.3.1