| 1 | { lib, ... }: |
| 2 | { |
| 3 | programs.jujutsu = { |
| 4 | enable = true; |
| 5 | # my workflow is based on creating changes and editing them. while they |
| 6 | # are in progress the description starts with "WIP: " |
| 7 | settings = rec { |
| 8 | colors = { |
| 9 | bookmark = "green"; |
| 10 | bookmarks = colors.bookmark; |
| 11 | local_bookmarks = colors.bookmarks; |
| 12 | remote_bookmarks = colors.bookmark; |
| 13 | "working_copy bookmark" = "bright green"; |
| 14 | "working_copy bookmarks" = colors."working_copy bookmark"; |
| 15 | "working_copy local_bookmarks" = colors."working_copy bookmark"; |
| 16 | "working_copy remote_bookmarks" = colors."working_copy bookmark"; |
| 17 | |
| 18 | "author" = { |
| 19 | fg = "bright black"; |
| 20 | bold = false; |
| 21 | italic = true; |
| 22 | }; |
| 23 | "working_copy author" = colors.author; |
| 24 | committer = { |
| 25 | fg = "bright black"; |
| 26 | bold = false; |
| 27 | }; |
| 28 | |
| 29 | desc = { |
| 30 | bold = true; |
| 31 | fg = "default"; |
| 32 | }; |
| 33 | description = colors.desc; |
| 34 | cc_wip = { |
| 35 | fg = "bright yellow"; |
| 36 | bold = true; |
| 37 | reverse = true; |
| 38 | }; |
| 39 | cc_header = { |
| 40 | bold = true; |
| 41 | fg = "default"; |
| 42 | }; |
| 43 | cc_feat = "green"; |
| 44 | cc_fix = "red"; |
| 45 | cc_hotfix = "red"; |
| 46 | cc_chore = "yellow"; |
| 47 | cc_test = "blue"; |
| 48 | cc_other = "blue"; |
| 49 | cc_scope = { |
| 50 | fg = "cyan"; |
| 51 | bold = false; |
| 52 | italic = true; |
| 53 | }; |
| 54 | |
| 55 | active_marker = { |
| 56 | fg = "bright magenta"; |
| 57 | bold = true; |
| 58 | reverse = true; |
| 59 | }; |
| 60 | "change_id shortest rest" = { |
| 61 | fg = "bright black"; |
| 62 | bold = true; |
| 63 | }; |
| 64 | conflict_marker = { |
| 65 | fg = "bright red"; |
| 66 | bold = true; |
| 67 | reverse = true; |
| 68 | }; |
| 69 | |
| 70 | timestamp = "bright black"; |
| 71 | "committer timestamp" = colors.committer; |
| 72 | commit_id = { |
| 73 | fg = "bright black"; |
| 74 | bold = false; |
| 75 | }; |
| 76 | muted = "bright black"; |
| 77 | }; |
| 78 | ui.default-command = lib.mkForce "show"; |
| 79 | # ui.graph.style = "square"; |
| 80 | revsets = { |
| 81 | short-prefixes = "(trunk()..@)::"; |
| 82 | }; |
| 83 | "template-aliases" = { |
| 84 | "format_log_author(commit)" = '' |
| 85 | if(commit.mine(), "You", commit.author().name().match("[^ ]+")) |
| 86 | ''; |
| 87 | "format_log_timestamp(timestamp)" = '' |
| 88 | if(timestamp.after("1 day ago"), timestamp.ago(), timestamp.local().format("%Y-%m-%d")) |
| 89 | ''; |
| 90 | "format_short_commit_header(commit)" = '' |
| 91 | separate(" ", |
| 92 | format_short_change_id_with_change_offset(commit), |
| 93 | label("author", format_log_author(commit)), |
| 94 | label("timestamp", format_log_timestamp(commit_timestamp(commit))), |
| 95 | commit.bookmarks(), |
| 96 | commit.tags(), |
| 97 | commit.working_copies(), |
| 98 | format_commit_labels(commit), |
| 99 | if(config("ui.show-cryptographic-signatures").as_boolean(), |
| 100 | format_short_cryptographic_signature(commit.signature()) |
| 101 | ), |
| 102 | ) |
| 103 | ''; |
| 104 | }; |
| 105 | aliases = { |
| 106 | "ab" = [ "abandon" ]; |
| 107 | "desc" = [ |
| 108 | "describe" |
| 109 | "--ignore-working-copy" |
| 110 | ]; |
| 111 | }; |
| 112 | }; |
| 113 | }; |
| 114 | } |