Add some ideas for git commands
This commit is contained in:
parent
519cc01454
commit
bc14726c1b
2 changed files with 27 additions and 2 deletions
|
@ -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 {
|
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 {
|
fun feature_checkout(feature: Text): Null {
|
||||||
echo "Checkout feature {feature}"
|
let branch = branch(feature)
|
||||||
|
|
||||||
|
echo "git checkout \"{branch}\""
|
||||||
}
|
}
|
||||||
|
|
||||||
fun feature_publish(feature: Text): Null {
|
fun feature_publish(feature: Text): Null {
|
||||||
|
|
11
config.ab
Normal file
11
config.ab
Normal 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"
|
||||||
|
}
|
Loading…
Reference in a new issue