aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2025-09-26 16:35:36 +0200
committerMartin Fischer <martin@push-f.com>2025-11-01 09:25:44 +0100
commitf884e4f2cbe866abe591279bfb99603f731080a3 (patch)
tree84dd06bc3b1b0f133b95e96e487b8c8acfe75371
parent22070abf191457cea8539fb7a88fc425565ff491 (diff)
tweak(user/jj): add configurationHEADmaster
-rw-r--r--user/git/ignore3
-rw-r--r--user/jj/config.toml46
2 files changed, 49 insertions, 0 deletions
diff --git a/user/git/ignore b/user/git/ignore
new file mode 100644
index 0000000..3b14573
--- /dev/null
+++ b/user/git/ignore
@@ -0,0 +1,3 @@
+# Prevent jj from auto-snapshotting these files when switching to an older
+# revision that doesn't yet have a Node package (nor the .gitignore entry).
+node_modules/
diff --git a/user/jj/config.toml b/user/jj/config.toml
index 72e8c4e..41f4bdf 100644
--- a/user/jj/config.toml
+++ b/user/jj/config.toml
@@ -6,3 +6,49 @@ email = "martin@push-f.com"
[ui]
pager = ["less", "--quit-if-one-screen", "--RAW-CONTROL-CHARS"]
+
+[aliases]
+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"]
+
+[template-aliases]
+# The default shows seconds which I don't care about.
+'format_timestamp(timestamp)' = 'timestamp.local().format("%Y-%m-%d %H:%M")'
+
+# Adapted builtin_log_oneline to only show change id and show author's timestamp instead of commit timestamp.
+my_log_oneline = 'builtin_log_oneline(self)'
+'builtin_log_oneline(commit)' = '''
+if(commit.root(),
+ format_root_commit(commit),
+ label(
+ separate(" ",
+ if(commit.current_working_copy(), "working_copy"),
+ if(commit.immutable(), "immutable", "mutable"),
+ if(commit.conflict(), "conflicted"),
+ ),
+ concat(
+ separate(" ",
+ format_short_signature_oneline(commit.author()),
+ format_timestamp(commit.author().timestamp()),
+ format_short_change_id_with_hidden_and_divergent_info(commit),
+ commit.bookmarks(),
+ commit.tags(),
+ commit.working_copies(),
+ if(commit.conflict(), label("conflict", "conflict")),
+ if(config("ui.show-cryptographic-signatures").as_boolean(),
+ format_short_cryptographic_signature(commit.signature())),
+ if(commit.empty(), label("empty", "(empty)")),
+ if(commit.description(),
+ commit.description().first_line(),
+ label(if(commit.empty(), "empty"), description_placeholder),
+ ),
+ ) ++ "\n",
+ ),
+ )
+)
+'''
+
+[colors]
+"diff removed token" = { bg = "#221111", underline = false }
+"diff added token" = { bg = "#002200", underline = false }