|
|
@@ -37,6 +37,36 @@ git-create() {
|
|
|
git commit -m "${message}"
|
|
|
}
|
|
|
|
|
|
+git-sync-release() {
|
|
|
+ rel="release/${1}"
|
|
|
+ br="$(git branch | grep '^\*' | cut -c3-)"
|
|
|
+
|
|
|
+ # Confirm that this is a real branch
|
|
|
+ (git branch -r | grep "${rel}" &>/dev/null) || return 1
|
|
|
+
|
|
|
+ # Merge dev
|
|
|
+ # Make sure that we're not doing a weird clobber
|
|
|
+ git checkout "${rel}" || return 2
|
|
|
+ # Sanity check...
|
|
|
+ git pull
|
|
|
+ git merge --ff-only origin/dev || return 3
|
|
|
+
|
|
|
+ # Update origin:release
|
|
|
+ git push
|
|
|
+ git checkout "${br}"
|
|
|
+
|
|
|
+ # Don't delete if we're on this branch
|
|
|
+ [[ "${br}" == "${rel}" ]] || git branch -D "${rel}"
|
|
|
+}
|
|
|
+
|
|
|
alias git-graph="git log --graph --pretty=oneline --abbrev-commit --decorate --all"
|
|
|
-alias git-cleanup='git branch --merged | egrep -v "(^\*|master|dev)" | xargs git branch -d'
|
|
|
+alias git-history-graph="git log --graph --pretty='format:%C(auto)%h (%<(50,trunc)%s, %ad)%d' --abbrev-commit --decorate --all"
|
|
|
+
|
|
|
+git-weeks-ago() {
|
|
|
+ weeks="${1:-1}"
|
|
|
+ end="$(date +"%Y-%m-%d" --date="${weeks} weeks ago Sunday")"
|
|
|
+ begin="$(date +"%Y-%m-%d" --date="$((weeks+1)) weeks ago Sunday")"
|
|
|
+ echo "--after ${begin} --before ${end}"
|
|
|
+}
|
|
|
|
|
|
+alias git-cleanup='(git branch --merged | egrep -v "(^\*|^\+|master|dev)" | xargs git branch -d); (git fetch --prune 2>&1 | grep deleted | sed "s/.*-> origin\///" | xargs git branch -D)'
|