175 lines
4.4 KiB
Nix
175 lines
4.4 KiB
Nix
{ config, pkgs, ... }:
|
||
{
|
||
programs.jujutsu = {
|
||
enable = true;
|
||
# package = pkgs.custom.jujutsu;
|
||
|
||
settings = {
|
||
user = {
|
||
email = "jana@donsz.nl";
|
||
name = "Jana Dönszelmann";
|
||
};
|
||
|
||
ui = {
|
||
paginate = "never";
|
||
# pager = "${pkgs.delta}/bin/delta";
|
||
# for delta
|
||
# diff-formatter = ":git";
|
||
diff-formatter = [
|
||
"${pkgs.difftastic}/bin/difft"
|
||
"--color=always"
|
||
"$left"
|
||
"$right"
|
||
];
|
||
|
||
default-command = [
|
||
"log"
|
||
"--reversed"
|
||
"--no-pager"
|
||
];
|
||
merge-editor = [
|
||
"${pkgs.meld}/bin/meld"
|
||
"$left"
|
||
"$base"
|
||
"$right"
|
||
"-o"
|
||
"$output"
|
||
"--auto-merge"
|
||
];
|
||
# diff-editor = "${pkgs.meld}/bin/meld";
|
||
};
|
||
|
||
core.fsmonitor = "watchman";
|
||
core.watchman.register-snapshot-trigger = true;
|
||
|
||
revsets.log = "@ | ancestors(tronk()..(visible_heads() & mine()), 2) | tronk()";
|
||
# revsets.log = "trunk()..@ | @..trunk() | trunk() | @:: | fork_point(trunk() | @)";
|
||
# revsets.log = "trunk() | ancestors(trunk()..heads(((trunk()..visible_heads()) & my() | @)::), 2)";
|
||
|
||
revset-aliases = {
|
||
"tronk()" = ''latest((present(main) | present(master)) & remote_bookmarks())'';
|
||
"my()" = "user(\"${config.programs.jujutsu.settings.user.email}\")";
|
||
"user(x)" = "author(x) | committer(x)";
|
||
current = ''bookmarks() & my() & ~immutable()'';
|
||
"closest_bookmark(to)" = "heads(::to & bookmarks())";
|
||
};
|
||
|
||
template-aliases = {
|
||
"format_timestamp(timestamp)" = "timestamp.ago()";
|
||
};
|
||
|
||
aliases =
|
||
let
|
||
util = script: [
|
||
"util"
|
||
"exec"
|
||
"--"
|
||
"bash"
|
||
"-c"
|
||
script
|
||
];
|
||
in
|
||
{
|
||
tug = [
|
||
"bookmark"
|
||
"move"
|
||
"--from"
|
||
"closest_bookmark(@-)"
|
||
"--to"
|
||
"@"
|
||
];
|
||
catchup = [
|
||
"rebase"
|
||
"-b"
|
||
"all:current"
|
||
"-d"
|
||
"tronk()"
|
||
"--skip-emptied"
|
||
];
|
||
pull = util ''
|
||
jj git fetch
|
||
jj catchup
|
||
'';
|
||
ch = [
|
||
"show"
|
||
"--stat"
|
||
];
|
||
st = [
|
||
"status"
|
||
];
|
||
move = [
|
||
"rebase"
|
||
"-r"
|
||
];
|
||
ll = [
|
||
"log"
|
||
"-T"
|
||
"builtin_log_compact"
|
||
];
|
||
mdiff = [
|
||
"diff"
|
||
"--from"
|
||
"tronk()"
|
||
];
|
||
};
|
||
|
||
templates = {
|
||
log_node = ''
|
||
label("node",
|
||
coalesce(
|
||
if(!self, label("elided", "~")),
|
||
if(current_working_copy, label("working_copy", "@")),
|
||
if(conflict, label("conflict", "×")),
|
||
if(immutable, label("immutable", "*")),
|
||
label("normal", "·")
|
||
)
|
||
)
|
||
'';
|
||
log = ''
|
||
if(root,
|
||
format_root_commit(self),
|
||
label(if(current_working_copy, "working_copy"),
|
||
concat(
|
||
separate(" ",
|
||
format_short_change_id_with_hidden_and_divergent_info(self),
|
||
if(empty, label("empty", "(empty)")),
|
||
if(description,
|
||
description.first_line(),
|
||
label(if(empty, "empty"), description_placeholder),
|
||
),
|
||
bookmarks,
|
||
tags,
|
||
working_copies,
|
||
if(git_head, label("git_head", "HEAD")),
|
||
if(conflict, label("conflict", "conflict")),
|
||
if(config("ui.show-cryptographic-signatures").as_boolean(),
|
||
format_short_cryptographic_signature(signature)),
|
||
) ++ "\n",
|
||
),
|
||
)
|
||
)
|
||
'';
|
||
};
|
||
|
||
signing = {
|
||
# sign-all = true;
|
||
behavior = "own";
|
||
backend = "ssh";
|
||
key = "~/.ssh/id_ed25519.pub";
|
||
};
|
||
|
||
git = {
|
||
push-bookmark-prefix = "jdonszelmann/";
|
||
private-commits = "description(glob:'wip:*') | description(glob:'trial:*')";
|
||
write-change-id-header = true;
|
||
|
||
fetch = [
|
||
"upstream"
|
||
"origin"
|
||
];
|
||
push = "origin";
|
||
auto-local-bookmark = true;
|
||
};
|
||
};
|
||
};
|
||
}
|