add jj tug alias

This commit is contained in:
2025-06-13 18:07:33 -06:00
parent 749b57966d
commit 0a3aac427b

View File

@@ -6,6 +6,19 @@ email = {{ .email | quote }}
editor = "nvim" editor = "nvim"
merge-editor = "vscode" merge-editor = "vscode"
pager = "delta" pager = "delta"
diff-formatter=":git"
[ui.diff] [aliases]
format = "git"
# tug - move the nearest bookmark to the nearest non-empty change at or before @
tug = ["bookmark", "move", "--from", "closest_bookmark(@)", "--to", "closest_nonempty(@)"]
# closestbookmark - show the name of the nearest bookmark at or before @
closestbookmark = ["util", "exec", "--", "bash", "-c", """
jj log --no-graph -r 'closest_bookmark(@)' -T 'stringify(local_bookmarks.map(|b| b.name()).join("\n")).first_line()++"\n"'
""", ""]
[revset-aliases]
'closest_bookmark(to)' = 'heads(::to & bookmarks())'
'closest_nonempty(to)' = 'heads(::to ~ empty())'