From 96f1b03a5faf7dcfa81818986d9365aa786d7d4d 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/jj/config.toml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'user/jj') 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