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
59# private-commits = "description(glob:'wip:*') | description(glob:'private:*')"
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
69[templates]
70draft_commit_description = '''
71concat(
72 coalesce(description, default_commit_description, "\n"),
73 if(
74 config("ui.should-sign-off").as_boolean() && !description.contains("Signed-off-by: " ++ author.name()),
75 "\nSigned-off-by: " ++ author.name() ++ " <" ++ author.email() ++ ">",
76 ),
77 surround(
78 "\nJJ: This commit contains the following changes:\n", "",
79 indent("JJ: ", diff.summary()),
80 ),
81 "\nJJ: ignore-rest\n",
82 diff.git(),
83)
84'''