mirror of
https://github.com/prdlk/dotfiles.git
synced 2026-11-02 11:32:42 +00:00
feat(cable): enhance repository preview with commit graph and add history action
This commit is contained in:
1 parent
9971d79c5c
commit
ab0aa2a548
3 files changed
+29
-6
No files matched your search
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"totalAccepted": 31,
|
||||
"totalAccepted": 41,
|
||||
"shownMilestones": [
|
||||
10,
|
||||
20
|
||||
],
|
||||
"submissionsSinceLastPrompt": 14,
|
||||
"submissionsSinceLastPrompt": 24,
|
||||
"windowStartedAt": 1790356839288,
|
||||
"lastShownAt": 1790359187702,
|
||||
"dismissed": true
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"lastCheck": 1790784309856,
|
||||
"lastCheck": 1790958825140,
|
||||
"latestVersion": "3.5.2",
|
||||
"hasBreakingChanges": false
|
||||
}
|
||||
@@ -5,7 +5,7 @@ ghq repositories (plus the chezmoi source tree) and Obsidian vaults, newest
|
||||
git activity first. Enter prints the directory; the gho shell function (ctrl-o
|
||||
in fish, zsh and bash) cds into it.
|
||||
"""
|
||||
requirements = ["ghq", "fd", "onefetch", "mtime-sort"]
|
||||
requirements = ["ghq", "fd", "git", "serie", "onefetch", "mtime-sort"]
|
||||
|
||||
# Entries are "<name>\t<absolute path>": the name is what you fuzzy-match, the
|
||||
# path is what enter prints. ctrl-s cycles repos → vaults.
|
||||
@@ -31,20 +31,35 @@ shell = "bash"
|
||||
display = "{split:\\t:0}"
|
||||
output = "{split:\\t:1}"
|
||||
|
||||
# Two previews, ctrl-f cycles: commit graph (default), then onefetch. serie
|
||||
# itself cannot draw here -- it is a fullscreen TUI that paints the graph with
|
||||
# kitty images and has no print mode -- so ctrl-g (history) opens it.
|
||||
[preview]
|
||||
command = '''
|
||||
command = [
|
||||
'''
|
||||
d='{split:\t:1}'
|
||||
if [ -e "$d/.git" ]; then
|
||||
git -C "$d" log --graph --all --color=always --date=relative -n 300 \
|
||||
--format='%C(yellow)%h%C(reset) %C(blue)%<(12,trunc)%ad%C(reset) %s%C(auto)%d' 2>&1
|
||||
else
|
||||
eza --tree --level 2 --color=always "$d" 2>/dev/null || ls -la "$d"
|
||||
fi
|
||||
''',
|
||||
'''
|
||||
d='{split:\t:1}'
|
||||
if [ -e "$d/.git" ]; then
|
||||
onefetch --no-art "$d" 2>&1
|
||||
else
|
||||
eza --tree --level 2 --color=always "$d" 2>/dev/null || ls -la "$d"
|
||||
fi
|
||||
'''
|
||||
''',
|
||||
]
|
||||
shell = "bash"
|
||||
|
||||
# ctrl-e (edit) is bound globally in config.toml.
|
||||
[keybindings]
|
||||
ctrl-b = "actions:browse"
|
||||
ctrl-g = "actions:history"
|
||||
|
||||
[actions.edit]
|
||||
description = "Open the repository in nvim"
|
||||
@@ -58,3 +73,11 @@ description = "Open the repository's web page (gop)"
|
||||
command = "cd '{split:\\t:1}' && gop >/dev/null 2>&1"
|
||||
shell = "bash"
|
||||
mode = "fork"
|
||||
|
||||
[actions.history]
|
||||
description = "Browse the commit graph in serie"
|
||||
# Fork: quitting serie (q) returns to the picker. /dev/tty for the same reason
|
||||
# as edit; serie also needs a real tty to detect kitty graphics.
|
||||
command = "cd '{split:\\t:1}' && [ -e .git ] && serie </dev/tty >/dev/tty"
|
||||
shell = "bash"
|
||||
mode = "fork"
|
||||
Reference in new issue
Block a user