|
|
|
@ -317,7 +317,30 @@ export def gc [
|
|
|
|
|
let a = if $all {[--all]} else {[]}
|
|
|
|
|
let n = if $amend {[--amend]} 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 diff
|
|
|
|
|