Skip to content

Commit

Permalink
users: jj templates
Browse files Browse the repository at this point in the history
  • Loading branch information
moni-dz committed Jan 24, 2025
1 parent 2935514 commit 861599f
Showing 1 changed file with 66 additions and 0 deletions.
66 changes: 66 additions & 0 deletions modules/shared/home-manager/vcs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
config,
lib,
pkgs,
self',
...
}:

{
home.packages = __attrValues {
inherit (pkgs.gitAndTools) gh;
inherit (pkgs) gnupg;
};

programs = {
Expand Down Expand Up @@ -41,6 +43,7 @@

jujutsu = {
inherit (config.programs.git) enable;
package = self'.packages.jujutsu;

settings = {
core.fsmonitor = "watchman";
Expand Down Expand Up @@ -127,8 +130,71 @@
];
};

templates = {
log = ''
if(root,
format_root_commit(self),
label(if(current_working_copy, "working_copy"),
concat(
separate(" ",
if(empty && description, label("empty", "merge")),
format_short_change_id_with_hidden_and_divergent_info(self),
format_short_commit_id(self.commit_id()),
self.bookmarks(),
self.tags(),
if(author.email(), author.email().local(), email_placeholder),
commit_timestamp(self).local().format("%Y-%m-%d"),
self.working_copies(),
if(self.git_head(), label("git_head", "git_head()")),
if(self.conflict(), label("conflict", "conflict")),
if(config("ui.show-cryptographic-signatures").as_boolean(),
format_short_cryptographic_signature(self.signature())),
)
++ "\n",
separate(" ",
if(empty && !description, label("empty", "(empty)")),
if(description,
description.first_line(),
label(if(empty, "empty"), label("description placeholder", "…")),
),
) ++ "\n",
),
)
) ++ "\n"
'';

log_node = ''
coalesce(
if(!self, label("elided", "…")),
label(
separate(" ",
if(current_working_copy, "working_copy"),
if(immutable, "immutable"),
if(conflict, "conflict"),
),
coalesce(
if(current_working_copy, "►"),
if(immutable, "■"),
if(conflict, "×"),
if(root, "⌂"),
"□",
)
)
)
'';

op_log_node = ''
coalesce(
if(current_operation, label("current_operation", "►")),
"□",
)
'';
};

ui = {
editor = "nvim";
graph.style = "square";
show-cryptographic-signatures = false;

default-command = [
"log"
Expand Down

0 comments on commit 861599f

Please sign in to comment.