Commit 96edd7c1 authored by Clive Makamara's avatar Clive Makamara Committed by GitHub

Merge pull request #15 from dreidev/develop

merge master
parents 82ff372c faff3ea5
node_modules/* node_modules/*
npm-debug.log npm-debug.log
npm-debug.log* npm-debug.log*
\ No newline at end of file gitflow/*
db/*
\ No newline at end of file
language: node_js
env:
- TRAVIS=true
node_js:
- "7"
- "6"
- "6.1"
- "5.11"
- "4"
- "iojs"
notifications:
email: false
script: npm install --ignore-scripts
\ No newline at end of file
# git-flow (Dreidev Edition) # git-flow (Dreidev Edition)
[![Build Status](https://travis-ci.org/dreidev/gitflow.svg?branch=master)](https://travis-ci.org/dreidev/gitflow) [![npm version](https://badge.fury.io/js/gitflow.svg)](https://badge.fury.io/js/gitflow) [![Dependencies](https://david-dm.org/dreidev/gitflow.svg)](https://david-dm.org/dreidev/gitflow)
A collection of Git extensions to provide high-level repository operations A collection of Git extensions to provide high-level repository operations
for Vincent Driessen's [branching model](http://nvie.com/git-model "original for Vincent Driessen's [branching model](http://nvie.com/git-model "original
blog post"). This fork adds functionality not added to the original branch. [wiki](http://github.com/dreidev/gitflow/wiki) blog post"). This fork adds functionality not added to the original branch. [wiki](http://github.com/dreidev/gitflow/wiki)
......
This diff is collapsed.
...@@ -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-flow -nf $NAME -p $PROJECT
echo $TIME_REQUIRED >> "./.git/.gitflow/.timelog-feature-$NAME" breakout-flow -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-flow -lf $NAME -p $PROJECT -m "Finished $NAME, merges into $DEVELOP_BRANCH"
if [ -f ./.git/.gitflow/.breaktime-feature-$NAME ]; breakout-flow -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
} }
...@@ -573,9 +555,15 @@ showcommands! Show git commands while executing them ...@@ -573,9 +555,15 @@ showcommands! Show git commands while executing them
git_do push -u "$ORIGIN" "$BRANCH:$BRANCH" git_do push -u "$ORIGIN" "$BRANCH:$BRANCH"
git_do fetch -q "$ORIGIN" "$BRANCH" || die "Could not fetch branch '$BRANCH' from remote '$ORIGIN'." git_do fetch -q "$ORIGIN" "$BRANCH" || die "Could not fetch branch '$BRANCH' from remote '$ORIGIN'."
git_do checkout "$BRANCH" || die "Could not check out branch '$BRANCH'." git_do checkout "$BRANCH" || die "Could not check out branch '$BRANCH'."
run_post_hook "$NAME" "$ORIGIN" "$BRANCH" run_post_hook "$NAME" "$ORIGIN" "$BRANCH"
PROJECT="$(basename $(git rev-parse --show-toplevel))"
breakout-flow -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-flow -lf $NAME -p $PROJECT -m "Took a break"
breakout-flow -hf $NAME -p $PROJECT
echo echo
echo "Summary of actions:" echo "Summary of actions:"
...@@ -947,37 +922,26 @@ cmd_interrupt() { ...@@ -947,37 +922,26 @@ cmd_interrupt() {
current_branch=$(git branch --no-color | grep '^\* ' | grep -v 'no branch' | sed 's/^* //g') current_branch=$(git branch --no-color | grep '^\* ' | grep -v 'no branch' | sed 's/^* //g')
current_name=$(echo "$current_branch" | sed "s ^$PREFIX g") current_name=$(echo "$current_branch" | sed "s ^$PREFIX g")
echo "dummy" >> "./$DOT_GIT_DIR/.gitflow/.interrupt-feature-$current_name"
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"
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-flow -lf $NAME -p $PROJECT -m "Was interrupted"
breakout-flow -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-flow -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-flow -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-flow -lf $NAME -p $PROJECT -m "Sent $NAME for review"
breakout-flow -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-flow -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.5
initialize() { initialize() {
# A function can not be empty. Comments count as empty. # A function can not be empty. Comments count as empty.
......
gitflow @ 82ff372c
Subproject commit 82ff372cb151ec7dc3732e58c8bfc20b943fb98e
{ {
"name": "gitflow", "name": "gitflow",
"version": "0.4.11", "version": "0.5.5",
"description": "Modified gitflow for dreidev", "description": "Modified gitflow for dreidev",
"main": "src/index.js", "main": "src/index.js",
"scripts": { "scripts": {
"postinstall": "curl https://raw.githubusercontent.com/dreidev/gitflow/develop/contrib/gitflow-installer.sh > gitflow-installer.sh; chmod a+x gitflow-installer.sh; sudo bash gitflow-installer.sh install stable", "postinstall": "curl https://raw.githubusercontent.com/dreidev/gitflow/develop/contrib/gitflow-installer.sh > gitflow-installer.sh; chmod a+x gitflow-installer.sh; if [ -z ${TRAVIS+x} ]; then sudo bash gitflow-installer.sh install stable; else bash gitflow-installer.sh install stable;exit 0;fi",
"postuninstall": "curl https://raw.githubusercontent.com/dreidev/gitflow/develop/contrib/gitflow-installer.sh > gitflow-installer.sh; chmod a+x gitflow-installer.sh; sudo bash gitflow-installer.sh uninstall" "postuninstall": "curl https://raw.githubusercontent.com/dreidev/gitflow/develop/contrib/gitflow-installer.sh > gitflow-installer.sh; chmod a+x gitflow-installer.sh; if [ -z ${TRAVIS+x} ]; then sudo bash gitflow-installer.sh uninstall; else sudo gitflow-installer.sh uninstall;exit 0;fi"
}, },
"files": [ "files": [
"src/" "src/"
], ],
"bin": { "bin": {
"flow": "src/flow.js" "breakout-flow": "./node_modules/breakout-timeline/bin/index.js"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
"url": "git+https://github.com/dreidev/gitflow.git" "url": "git+https://github.com/dreidev/gitflow.git"
}, },
"os": [
"!win32"
],
"keywords": [ "keywords": [
"gitflow", "gitflow",
"dreidev", "dreidev",
"version", "version",
"control", "control",
"git", "git",
"drazious",
"cmosh" "cmosh"
], ],
"author": { "author": {
...@@ -31,13 +33,14 @@ ...@@ -31,13 +33,14 @@
"email": "clive@makamara.me", "email": "clive@makamara.me",
"url": "http://github.com/cmosh", "url": "http://github.com/cmosh",
"organization": "dreidev" "organization": "dreidev"
}, },
"license": "LGPL", "license": "MIT",
"bugs": { "bugs": {
"url": "https://github.com/dreidev/gitflow/issues" "url": "https://github.com/dreidev/gitflow/issues"
}, },
"homepage": "https://github.com/dreidev/gitflow#readme", "homepage": "https://github.com/dreidev/gitflow#readme",
"dependencies": { "dependencies": {
"breakout-timeline": "0.0.4",
"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