chore: rearrange directories

This commit is contained in:
iff 2024-12-08 16:52:53 +01:00
parent d5fb7462e0
commit 4c9aac45a8
46 changed files with 11 additions and 18 deletions

111
core/rules/git.toml Normal file
View file

@ -0,0 +1,111 @@
command = "git"
[[match_err]]
pattern = [
"is not a git command"
]
suggest = [
'''
{{command[0]}} {{typo[1](
add,
am,
archive,
bisect,
branch,
bundle,
checkout,
cherry-pick,
citool,
clean,
clone,
commit,
describe,
diff,
fetch,
format-patch,
gc,
gitk,
grep,
gui,
init,
log,
maintenance,
merge,
mv,
notes,
pull,
push,
range-diff,
rebase,
reset,
restore,
revert,
rm,
scalar,
shortlog,
show,
sparse-checkout,
stash,
status,
submodule,
switch,
tag,
worktree,
config,
fast-export,
fast-import,
filter-branch,
mergetool,
pack-refs,
prune,
reflog,
remote,
repack,
replace,
)}} {{command[2:]}}'''
]
[[match_err]]
pattern = [
"did not match any file"
]
# alternatively `git checkout {{typo[2]({{shell(git branch | sed 's/^*//')}})}}`
suggest = [
'''
#[cmd_contains(checkout)]
git checkout {{typo[2]({{shell(git branch | sed 's/^*//')}})}} ''',
'''
#[cmd_contains(checkout)]
git branch {{command[2]}} && \
git checkout {{command[2]}} '''
]
[[match_err]]
pattern = [
"has no upstream branch"
]
suggest = [
'''
#[cmd_contains(push)]
git push --set-upstream origin {{shell(git rev-parse --abbrev-ref HEAD)}} '''
]
[[match_err]]
pattern = [
"no tracking information for the current branch"
]
suggest = [
'''
#[cmd_contains(pull)]
git pull --set-upstream origin {{shell(git rev-parse --abbrev-ref HEAD)}} '''
]
[[match_err]]
pattern = [
"a branch named"
]
suggest = [
'''
#[cmd_contains(branch)]
git checkout {{command[2]}} '''
]