Skip to content

Commit

Permalink
feat(jj): include diff in default commit template
Browse files Browse the repository at this point in the history
This makes it mimic `git commit --verbose` which I like.
  • Loading branch information
jalil-salame committed Dec 22, 2024
1 parent 7e7c5d6 commit e6a6f63
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions home/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,20 @@ in
enable = true;
settings = {
ui.pager = "bat";
# mimic git commit --verbose by adding a diff
templates.draft_commit_description = ''
concat(
description,
surround(
"\nJJ: This commit contains the following changes:\n", "",
indent("JJ: ", diff.stat()),
),
surround(
"\nJJ: Diff:\n", "",
indent("JJ: ", diff.git()),
),
)
'';
};
};
};
Expand Down

0 comments on commit e6a6f63

Please sign in to comment.