Commit c5111e97 authored by Clive Makamara's avatar Clive Makamara

Merge branch 'release/0.5.0'

parents 82ff372c bdfaf403
...@@ -80,6 +80,7 @@ install) ...@@ -80,6 +80,7 @@ install)
stable) stable)
cd "$REPO_NAME" cd "$REPO_NAME"
git checkout master git checkout master
npm i -g breakout-timeline
cd "$OLDPWD" cd "$OLDPWD"
;; ;;
develop) develop)
......
...@@ -230,16 +230,11 @@ F,[no]fetch Fetch from origin before performing local operation ...@@ -230,16 +230,11 @@ F,[no]fetch Fetch from origin before performing local operation
echo "How long do you think this feature will take in hours (e.g 1.5)?" echo "How long do you think this feature will take in hours (e.g 1.5)?"
read TIME_REQUIRED read TIME_REQUIRED
PROJECT="$(basename $(git rev-parse --show-toplevel))"
breakout-timeline -nf $NAME -p $PROJECT
echo $TIME_REQUIRED >> "./.git/.gitflow/.timelog-feature-$NAME" breakout-timeline -lf $NAME -p $PROJECT -m "Time Required:$TIME_REQUIRED"
git add .
git commit --allow-empty -m "--Flow message(start) -- Started working on $BRANCH on $(date) estimated Time $TIME_REQUIRED hour(s)"
echo $(date +%s) >> "./.git/.gitflow/.timelog-feature-$NAME"
echo echo
echo "Summary of actions:" echo "Summary of actions:"
...@@ -444,29 +439,16 @@ no-ff! Never fast-forward during the merge ...@@ -444,29 +439,16 @@ no-ff! Never fast-forward during the merge
# When no merge conflict is detected, just clean up the feature branch # When no merge conflict is detected, just clean up the feature branch
gitflow_config_remove_base_branch "$BRANCH" gitflow_config_remove_base_branch "$BRANCH"
echo $(date +%s) >> "./.git/.gitflow/.timelog-feature-$NAME" ######################
LAST_TIME=$(tail -1 .git/.gitflow/.timelog-feature-$NAME | head -1) #TODO
PREV_TIME=$(tail -2 .git/.gitflow/.timelog-feature-$NAME | head -1) #Insert timer here
TIME_USED=$((LAST_TIME-PREV_TIME)) PROJECT="$(basename $(git rev-parse --show-toplevel))"
echo "$TIME_USED" >> "./.git/.gitflow/.seconds-feature-$NAME" breakout-timeline -lf $NAME -p $PROJECT -m "Finished $NAME, merges into $DEVELOP_BRANCH"
if [ -f ./.git/.gitflow/.breaktime-feature-$NAME ]; breakout-timeline -xf $NAME -p $PROJECT
then
TOTAL_BREAK_TIME=$(awk '{ sum += $1 } END { print sum }' ./.git/.gitflow/.breaktime-feature-$NAME)
else
TOTAL_BREAK_TIME=0
fi
TOTAL_TIME=$(awk '{ sum += $1 } END { print sum }' ./.git/.gitflow/.seconds-feature-$NAME)
TIME_EXPECTED=$(head -n 1 ./.git/.gitflow/.timelog-feature-$NAME)
FINALTIME=$((TOTAL_TIME/86400))" days "$(date -d "1970-01-01 + $TOTAL_TIME seconds" "+%H hours %M minutes %S seconds")
TOTAL_TIME_OFF=$((TOTAL_BREAK_TIME/86400))" days "$(date -d "1970-01-01 + $TOTAL_BREAK_TIME seconds" "+%H hours %M minutes %S seconds")
git commit --allow-empty -m "--Flow message(finish) --$BRANCH was completed on $(date), total time taken:$FINALTIME expectde time was $TIME_EXPECTED hour(s), Time spent on breaks was $TOTAL_TIME_OFF"
helper_finish_cleanup helper_finish_cleanup
} }
...@@ -576,6 +558,12 @@ showcommands! Show git commands while executing them ...@@ -576,6 +558,12 @@ showcommands! Show git commands while executing them
run_post_hook "$NAME" "$ORIGIN" "$BRANCH" run_post_hook "$NAME" "$ORIGIN" "$BRANCH"
PROJECT="$(basename $(git rev-parse --show-toplevel))"
breakout-timeline -lf $NAME -p $PROJECT -m "Published $NAME sent for review"
echo echo
echo "Summary of actions:" echo "Summary of actions:"
echo "- The remote branch '$BRANCH' was created or updated" echo "- The remote branch '$BRANCH' was created or updated"
...@@ -891,31 +879,18 @@ cmd_pause() { ...@@ -891,31 +879,18 @@ cmd_pause() {
current_name=$(echo "$current_branch" | sed "s ^$PREFIX g") current_name=$(echo "$current_branch" | sed "s ^$PREFIX g")
echo $(date +%s) >> "./.git/.gitflow/.timelog-feature-$current_name"
LAST_TIME=$(tail -1 .git/.gitflow/.timelog-feature-$current_name | head -1)
PREV_TIME=$(tail -2 .git/.gitflow/.timelog-feature-$current_name | head -1)
TIME_USED=$((LAST_TIME-PREV_TIME))
echo "$TIME_USED" >> "./.git/.gitflow/.seconds-feature-$current_name"
seconds=$TIME_USED; TIMESTAMP=$((seconds/86400))" days "$(date -d "1970-01-01 + $seconds seconds" "+%H hours %M minutes %S seconds")
git add --all . git add --all .
git commit -m "$current_branch/WIP" git commit -m "$current_branch/WIP"
git commit --allow-empty -m "--Flow message(pause) -- $current_branch/WIP time-paused:$(date), time taken thus far:$TIMESTAMP"
git checkout -b "$current_branch-paused" "flopharn" git checkout -b "$current_branch-paused" "flopharn"
git rm * --quiet --ignore-unmatch git rm * --quiet --ignore-unmatch
PROJECT="$(basename $(git rev-parse --show-toplevel))"
breakout-timeline -lf $NAME -p $PROJECT -m "Took a break"
breakout-timeline -hf $NAME -p $PROJECT
echo echo
echo "Summary of actions:" echo "Summary of actions:"
...@@ -949,35 +924,24 @@ cmd_interrupt() { ...@@ -949,35 +924,24 @@ cmd_interrupt() {
current_name=$(echo "$current_branch" | sed "s ^$PREFIX g") current_name=$(echo "$current_branch" | sed "s ^$PREFIX g")
echo $(date +%s) >> "./.git/.gitflow/.timelog-feature-$current_name" echo "dummy" >> "./$DOT_GIT_DIR/.gitflow/.interrupt-feature-$current_name"
LAST_TIME=$(tail -1 .git/.gitflow/.timelog-feature-$current_name | head -1)
PREV_TIME=$(tail -2 .git/.gitflow/.timelog-feature-$current_name | head -1)
TIME_USED=$((LAST_TIME-PREV_TIME))
echo "$TIME_USED" >> "./.git/.gitflow/.seconds-feature-$current_name"
echo "dummy" >> "./.git/.gitflow/.interrupt-feature-$current_name"
seconds=$TIME_USED; TIMESTAMP=$((seconds/86400))" days "$(date -d "1970-01-01 + $seconds seconds" "+%H hours %M minutes %S seconds")
git add --all . git add --all .
git commit -m "$current_branch/WIP" git commit -m "$current_branch/WIP"
git commit --allow-empty -m "--Flow message(interrupt) --$current_branch/WIP You were disturbed on $(date), time taken so far:$TIMESTAMP"
git checkout -b "$current_branch-paused" "flopharn" git checkout -b "$current_branch-paused" "flopharn"
git rm * --quiet --ignore-unmatch git rm * --quiet --ignore-unmatch
PROJECT="$(basename $(git rev-parse --show-toplevel))"
breakout-timeline -lf $NAME -p $PROJECT -m "Was interrupted"
breakout-timeline -hf $NAME -p $PROJECT
echo echo
echo "Summary of actions:" echo "Summary of actions:"
echo "- Created orphan branch called '$current_branch-paused'" echo "- Created orphan branch called '$current_branch-paused'"
echo "- You are now free to take a break, you have spent $TIMESTAMP in this session" echo "- You are now free to take a break"
echo "" echo ""
echo "Now, have some coffee and when you are done, use:" echo "Now, have some coffee and when you are done, use:"
echo "" echo ""
...@@ -994,46 +958,36 @@ Allows you to continue working on a feature after using pause or interrupt ...@@ -994,46 +958,36 @@ Allows you to continue working on a feature after using pause or interrupt
---- ----
h,help! Show this help h,help! Show this help
" "
PROJECT="$(basename $(git rev-parse --show-toplevel))"
parse_args "$@" parse_args "$@"
gitflow_require_name_arg gitflow_require_name_arg
# sanity checks # sanity checks
require_branch "$BRANCH" require_branch "$BRANCH"
if [ -f ./.git/.gitflow/.interrupt-feature-$NAME ]; if [ -f ./$DOT_GIT_DIR/.gitflow/.interrupt-feature-$NAME ];
then then
echo "Why were you interrupted?" echo "Why were you interrupted?"
read INTERRUPT_REASON read INTERRUPT_REASON
rm ./.git/.gitflow/.interrupt-feature-$NAME
breakout-timeline -lf $NAME -p $PROJECT -m "Reason for interrupt $INTERRUPT_REASON"
else else
INTERRUPT_REASON="No reason :)" INTERRUPT_REASON="No reason :)"
fi fi
LAST_TIME=$(date +%s)
PREV_TIME=$(tail -1 .git/.gitflow/.timelog-feature-$NAME | head -1)
BREAK_TIME=$((LAST_TIME-PREV_TIME))
echo "$BREAK_TIME" >> "./.git/.gitflow/.breaktime-feature-$NAME"
seconds=$BREAK_TIME; TIME_OFF=$((seconds/86400))" days "$(date -d "1970-01-01 + $seconds seconds" "+%H hours %M minutes %S seconds")
git add . git add .
git commit --allow-empty -m "--Flow message(resume)"
git checkout "$BRANCH" git checkout "$BRANCH"
git branch -D "$BRANCH-paused" git branch -D "$BRANCH-paused"
git commit --allow-empty -m "--Flow message(resume) --$BRANCH/Back to Work at:$(date) Time off:$TIME_OFF, Reason: $INTERRUPT_REASON" breakout-timeline -rf $NAME -p $PROJECT
echo $(date +%s) >> "./.git/.gitflow/.timelog-feature-$NAME"
echo echo
echo "Summary of actions:" echo "Summary of actions:"
...@@ -1074,30 +1028,10 @@ h,help! Show this help ...@@ -1074,30 +1028,10 @@ h,help! Show this help
git_do config "branch.$BRANCH.merge" "refs/heads/$BRANCH" git_do config "branch.$BRANCH.merge" "refs/heads/$BRANCH"
git_do checkout "$BRANCH" git_do checkout "$BRANCH"
PROJECT="$(basename $(git rev-parse --show-toplevel))"
breakout-timeline -lf $NAME -p $PROJECT -m "Sent $NAME for review"
breakout-timeline -xf $NAME -p $PROJECT
echo $(date +%s) >> "./.git/.gitflow/.timelog-feature-$NAME"
LAST_TIME=$(tail -1 .git/.gitflow/.timelog-feature-$NAME | head -1)
PREV_TIME=$(tail -2 .git/.gitflow/.timelog-feature-$NAME | head -1)
TIME_USED=$((LAST_TIME-PREV_TIME))
echo "$TIME_USED" >> "./.git/.gitflow/.seconds-feature-$NAME"
if [ -f ./.git/.gitflow/.breaktime-feature-$NAME ];
then
TOTAL_BREAK_TIME=$(awk '{ sum += $1 } END { print sum }' ./.git/.gitflow/.breaktime-feature-$NAME)
else
TOTAL_BREAK_TIME=0
fi
TOTAL_TIME=$(awk '{ sum += $1 } END { print sum }' ./.git/.gitflow/.seconds-feature-$NAME)
TIME_EXPECTED=$(head -n 1 ./.git/.gitflow/.timelog-feature-$NAME)
FINALTIME=$((TOTAL_TIME/86400))" days "$(date -d "1970-01-01 + $TOTAL_TIME seconds" "+%H hours %M minutes %S seconds")
TOTAL_TIME_OFF=$((TOTAL_BREAK_TIME/86400))" days "$(date -d "1970-01-01 + $TOTAL_BREAK_TIME seconds" "+%H hours %M minutes %S seconds")
git commit --allow-empty -m "--Flow message(finish) --$BRANCH was completed on $(date), total time taken:$FINALTIME expected time was $TIME_EXPECTED hour(s), Time spent on breaks was $TOTAL_TIME_OFF"
GIT_URL=$(git config --get remote.origin.url) GIT_URL=$(git config --get remote.origin.url)
GIT_URL_WITHOUT_SUFFIX="${GIT_URL%.*}" GIT_URL_WITHOUT_SUFFIX="${GIT_URL%.*}"
...@@ -1106,11 +1040,11 @@ h,help! Show this help ...@@ -1106,11 +1040,11 @@ h,help! Show this help
OWNER=$(basename $(echo $URL_WITH_OWNER | tr ":" /)) OWNER=$(basename $(echo $URL_WITH_OWNER | tr ":" /))
DEVELOPMENT_BRANCH=$(git config --get gitflow.branch.develop) DEVELOPMENT_BRANCH=$(git config --get gitflow.branch.develop)
if [ -f ./.git/.gitflow/.github_token ]; if [ -f ./$DOT_GIT_DIR/.gitflow/.github_token ];
then then
GITHUB_USERNAME=$(tail -1 ./.git/.gitflow/.github_username | head -1) GITHUB_USERNAME=$(tail -1 ./$DOT_GIT_DIR/.gitflow/.github_username | head -1)
GITHUB_TOKEN=$(tail -1 ./.git/.gitflow/.github_token | head -1) GITHUB_TOKEN=$(tail -1 ./$DOT_GIT_DIR/.gitflow/.github_token | head -1)
GITHUB_REQUEST=$(curl -X POST --write-out %{http_code} --silent --output /dev/null -H "Content-Type: application/json" \ GITHUB_REQUEST=$(curl -X POST --write-out %{http_code} --silent --output /dev/null -H "Content-Type: application/json" \
-H "Cache-Control: no-cache" \ -H "Cache-Control: no-cache" \
...@@ -1135,10 +1069,10 @@ h,help! Show this help ...@@ -1135,10 +1069,10 @@ h,help! Show this help
fi fi
if [ -f ./.git/.gitflow/.gitlab_token ]; if [ -f ./$DOT_GIT_DIR/.gitflow/.gitlab_token ];
then then
GITLAB_TOKEN=$(tail -1 ./.git/.gitflow/.gitlab_token | head -1) GITLAB_TOKEN=$(tail -1 ./$DOT_GIT_DIR/.gitflow/.gitlab_token | head -1)
USER_NAME=$(git config --get --global user.name) USER_NAME=$(git config --get --global user.name)
GITLAB_REQUEST=$(curl -X POST --write-out %{http_code} --silent --output /dev/null -H "PRIVATE-TOKEN: $GITLAB_TOKEN" -H "Content-Type: application/json" -H "Cache-Control: no-cache" -H "Postman-Token: 209ed2f2-a7bd-ab33-a432-1d884669976b" -d '{ GITLAB_REQUEST=$(curl -X POST --write-out %{http_code} --silent --output /dev/null -H "PRIVATE-TOKEN: $GITLAB_TOKEN" -H "Content-Type: application/json" -H "Cache-Control: no-cache" -H "Postman-Token: 209ed2f2-a7bd-ab33-a432-1d884669976b" -d '{
......
...@@ -409,10 +409,13 @@ file= use given config file ...@@ -409,10 +409,13 @@ file= use given config file
mkdir -p "./.git/.gitflow" mkdir -p "./.git/.gitflow"
git checkout --orphan flopharn git checkout --orphan flopharn
git rm * --quiet --ignore-unmatch git rm * --quiet --ignore-unmatch
git commit --allow-empty -m "flopharn was created successfully" git commit --allow-empty -m "Git flow Initialized successfully"
git checkout $develop_branch git checkout $develop_branch
PROJECT="$(basename $(git rev-parse --show-toplevel))"
breakout-timeline -np $PROJECT
if git remote -v | grep github > /dev/null if git remote -v | grep github > /dev/null
then then
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# #
GITFLOW_VERSION=0.4.11 GITFLOW_VERSION=0.5.0
initialize() { initialize() {
# A function can not be empty. Comments count as empty. # A function can not be empty. Comments count as empty.
......
{ {
"name": "gitflow", "name": "gitflow",
"version": "0.4.11", "version": "0.5.0",
"description": "Modified gitflow for dreidev", "description": "Modified gitflow for dreidev",
"main": "src/index.js", "main": "src/index.js",
"scripts": { "scripts": {
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"src/" "src/"
], ],
"bin": { "bin": {
"flow": "src/flow.js" "flow": "./git-flow"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
"version", "version",
"control", "control",
"git", "git",
"drazious",
"cmosh" "cmosh"
], ],
"author": { "author": {
...@@ -38,6 +37,7 @@ ...@@ -38,6 +37,7 @@
}, },
"homepage": "https://github.com/dreidev/gitflow#readme", "homepage": "https://github.com/dreidev/gitflow#readme",
"dependencies": { "dependencies": {
"breakout-timeline": "0.0.3",
"commander": "^2.9.0", "commander": "^2.9.0",
"shelljs": "^0.7.6" "shelljs": "^0.7.6"
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment