dotfiles
1"$schema" = "https://jj-vcs.github.io/jj/latest/config-schema.json"
2
3[aliases]
4su = ["squash"]
5tug = ["bookmark", "move", "--from", "heads(::@- & bookmarks())", "--to", "@-"]
6# mega-merge pull
7mp = ["rebase", "-b", "MM", "-d", "heads(MM- | trunk())"]
8mm = ["util", "exec", "--", "bash", "-c", """#!/usr/bin/env bash
9set -euo pipefail
10
11COMMAND="${1:-}"
12shift # remove the subcommand from the arg list
13
14case "$COMMAND" in
15 add|a)
16 [ $# -ne 2 ] && {
17 echo "Add <dest> to <target>"
18 echo
19 echo "Usage: jj mm add <target> <dest>"
20 exit 1
21 }
22 jj rebase -s $1 -o "heads($1-) | $2"
23 ;;
24 del|d)
25 [ $# -ne 2 ] && { echo "Usage: jj mm del <target> <dest>"; exit 1; }
26 jj rebase -s $1 -o "heads($1-) ~ $2"
27 ;;
28 clean)
29 [ $# -ne 1 ] && { echo "Usage: jj mm clean <target>"; exit 1; }
30 jj rebase -s $1 -o "heads($1-)"
31 ;;
32 *)
33 echo "Error: Unknown subcommand '$COMMAND'"
34 echo "Usage: jj mm [add|del]"
35 exit 1
36 ;;
37esac
38""", ""]
39
40[ui]
41default-command = ["log", "--no-pager", "-r", "@ | coalesce(mega_merge(), default()) | trunk()"]
42should-sign-off = true
43# diff-formatter = ["difft", "--color=always", "--syntax-highlight=off", "$left", "$right"]
44# diff-editor = ["nvim", "-c", "DiffEditor $left $right $output"]
45# merge-editor = "vimdiff"
46# conflict-marker-style = "git"
47
48[user]
49name = "Seongmin Lee"
50email = "git@boltless.me"
51
52[signing]
53behavior = "own"
54backend = "ssh"
55key = "~/.ssh/git-sign-key.pub"
56
57[git]
58write-change-id-header = true
59private-commits = "description(glob:'private:*') | description(glob:'local:*')"
60
61[revset-aliases]
62'MM' = "description(glob:'\\[mega-merge\\]*')"
63'FP' = "fork_point(MM-)"
64'wip' = "description(glob:'wip:*')"
65'default()' = "@ | ancestors(immutable_heads().., 2) | trunk()"
66'show(x)' = "@ | ancestors(..(x::) ~ immutable(), 2) | trunk()"
67'mega_merge()' = "ancestors(..(MM::) ~ immutable(), 2)"
68# 'immutable_heads()' = "heads(~mine())"
69'immutable_heads()' = "builtin_immutable_heads() ~ mine()"
70
71[templates]
72draft_commit_description = '''
73concat(
74 coalesce(description, default_commit_description, "\n"),
75 if(
76 config("ui.should-sign-off").as_boolean() && !description.contains("Signed-off-by: " ++ author.name()),
77 "\nSigned-off-by: " ++ author.name() ++ " <" ++ author.email() ++ ">",
78 ),
79 surround(
80 "\nJJ: This commit contains the following changes:\n", "",
81 indent("JJ: ", diff.summary()),
82 ),
83 "\nJJ: ignore-rest\n",
84 diff.git(),
85)
86'''