Add git commit prompt

main
Julius Riegel 7 months ago
parent f332be7c36
commit 7a1e3cf345

@ -317,8 +317,31 @@ export def gc [
let a = if $all {[--all]} else {[]} let a = if $all {[--all]} else {[]}
let n = if $amend {[--amend]} else {[]} let n = if $amend {[--amend]} else {[]}
let k = if $keep {[--no-edit]} else {[]} let k = if $keep {[--no-edit]} else {[]}
if $message == null and (glob "*commitlint*" | length) > 0 {
let type = ([ci chore feat fix docs test refactor] | input list "Change type")
let subject = input "Subject: "
let message = input "Message: "
if $message == null or ($message | str length) == 0 {
error make {msg: "The commit message can't be empty"}
}
let message = if $subject != null and ($subject | str length) > 0 {
$"($type)\(($subject)\): ($message)"
} else {
$"($type): ($message)"
}
print $"(ansi {attr: i})($message)(ansi reset)"
let m = $message | with-flag -m
git commit -v -e ...$m ...$a ...$n ...$k
} else {
git commit -v ...$m ...$a ...$n ...$k git commit -v ...$m ...$a ...$n ...$k
} }
}
# git diff # git diff
export def gd [ export def gd [

@ -61,6 +61,7 @@ config.modules = {
'pueue', 'pueue',
'parallel', 'parallel',
'bat', 'bat',
'cz-cli',
}, },
gui = mod { gui = mod {
'kdePackages.breeze-icons', 'kdePackages.breeze-icons',

Loading…
Cancel
Save