Add some ideas for git commands

This commit is contained in:
Alex 2024-07-25 18:36:55 +02:00
parent 519cc01454
commit bc14726c1b
Signed by: l-x
SSH key fingerprint: SHA256:MK3uQVPHEV0Oo2ry/dAqvVK3pAwegKAwSlyfgLd/yQM
2 changed files with 27 additions and 2 deletions

View file

@ -1,9 +1,23 @@
import * from "../config.ab"
fun branch(feature: Text): Text {
let prefix = get_feature_prefix()
return "{prefix}{feature}"
}
fun feature_start(feature: Text, description: Text): Null {
echo "Create feature {feature} ({description})"
let branch = branch(feature)
let base = get_dev_branch()
echo "git switch -c {branch} {base}"
echo "git config --no-add branch.\"{branch}\".description \"{description}\""
}
fun feature_checkout(feature: Text): Null {
echo "Checkout feature {feature}"
let branch = branch(feature)
echo "git checkout \"{branch}\""
}
fun feature_publish(feature: Text): Null {

11
config.ab Normal file
View file

@ -0,0 +1,11 @@
pub fun get_feature_prefix(): Text {
return "feature/"
}
pub fun get_dev_branch(): Text {
return "develop"
}
pub fun get_push_remote(): Text {
return "origin"
}