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/*
npm-debug.log
npm-debug.log*
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)
[![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
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)
......
......@@ -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)?"
read TIME_REQUIRED
PROJECT="$(basename $(git rev-parse --show-toplevel))"
breakout-flow -nf $NAME -p $PROJECT
echo $TIME_REQUIRED >> "./.git/.gitflow/.timelog-feature-$NAME"
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"
breakout-flow -lf $NAME -p $PROJECT -m "Time Required:$TIME_REQUIRED"
echo
echo "Summary of actions:"
......@@ -444,29 +439,16 @@ no-ff! Never fast-forward during the merge
# When no merge conflict is detected, just clean up the feature 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)
PREV_TIME=$(tail -2 .git/.gitflow/.timelog-feature-$NAME | head -1)
#TODO
#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 ];
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"
breakout-flow -xf $NAME -p $PROJECT
helper_finish_cleanup
}
......@@ -576,6 +558,12 @@ showcommands! Show git commands while executing them
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 "Summary of actions:"
echo "- The remote branch '$BRANCH' was created or updated"
......@@ -891,31 +879,18 @@ cmd_pause() {
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 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 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 "Summary of actions:"
......@@ -949,35 +924,24 @@ cmd_interrupt() {
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"
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")
echo "dummy" >> "./$DOT_GIT_DIR/.gitflow/.interrupt-feature-$current_name"
git add --all .
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 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 "Summary of actions:"
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 "Now, have some coffee and when you are done, use:"
echo ""
......@@ -994,46 +958,36 @@ Allows you to continue working on a feature after using pause or interrupt
----
h,help! Show this help
"
PROJECT="$(basename $(git rev-parse --show-toplevel))"
parse_args "$@"
gitflow_require_name_arg
# sanity checks
require_branch "$BRANCH"
if [ -f ./.git/.gitflow/.interrupt-feature-$NAME ];
if [ -f ./$DOT_GIT_DIR/.gitflow/.interrupt-feature-$NAME ];
then
echo "Why were you interrupted?"
read INTERRUPT_REASON
rm ./.git/.gitflow/.interrupt-feature-$NAME
breakout-flow -lf $NAME -p $PROJECT -m "Reason for interrupt $INTERRUPT_REASON"
else
INTERRUPT_REASON="No reason :)"
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 commit --allow-empty -m "--Flow message(resume)"
git checkout "$BRANCH"
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"
echo $(date +%s) >> "./.git/.gitflow/.timelog-feature-$NAME"
breakout-flow -rf $NAME -p $PROJECT
echo
echo "Summary of actions:"
......@@ -1074,30 +1028,10 @@ h,help! Show this help
git_do config "branch.$BRANCH.merge" "refs/heads/$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_WITHOUT_SUFFIX="${GIT_URL%.*}"
......@@ -1106,11 +1040,11 @@ h,help! Show this help
OWNER=$(basename $(echo $URL_WITH_OWNER | tr ":" /))
DEVELOPMENT_BRANCH=$(git config --get gitflow.branch.develop)
if [ -f ./.git/.gitflow/.github_token ];
if [ -f ./$DOT_GIT_DIR/.gitflow/.github_token ];
then
GITHUB_USERNAME=$(tail -1 ./.git/.gitflow/.github_username | head -1)
GITHUB_TOKEN=$(tail -1 ./.git/.gitflow/.github_token | head -1)
GITHUB_USERNAME=$(tail -1 ./$DOT_GIT_DIR/.gitflow/.github_username | 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" \
-H "Cache-Control: no-cache" \
......@@ -1135,10 +1069,10 @@ h,help! Show this help
fi
if [ -f ./.git/.gitflow/.gitlab_token ];
if [ -f ./$DOT_GIT_DIR/.gitflow/.gitlab_token ];
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)
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
mkdir -p "./.git/.gitflow"
git checkout --orphan flopharn
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
PROJECT="$(basename $(git rev-parse --show-toplevel))"
breakout-flow -np $PROJECT
if git remote -v | grep github > /dev/null
then
......
......@@ -35,7 +35,7 @@
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
GITFLOW_VERSION=0.4.11
GITFLOW_VERSION=0.5.5
initialize() {
# A function can not be empty. Comments count as empty.
......
gitflow @ 82ff372c
Subproject commit 82ff372cb151ec7dc3732e58c8bfc20b943fb98e
{
"name": "gitflow",
"version": "0.4.11",
"version": "0.5.5",
"description": "Modified gitflow for dreidev",
"main": "src/index.js",
"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",
"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"
"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; if [ -z ${TRAVIS+x} ]; then sudo bash gitflow-installer.sh uninstall; else sudo gitflow-installer.sh uninstall;exit 0;fi"
},
"files": [
"src/"
],
"bin": {
"flow": "src/flow.js"
"breakout-flow": "./node_modules/breakout-timeline/bin/index.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/dreidev/gitflow.git"
},
"os": [
"!win32"
],
"keywords": [
"gitflow",
"dreidev",
"version",
"control",
"git",
"drazious",
"cmosh"
],
"author": {
......@@ -32,12 +34,13 @@
"url": "http://github.com/cmosh",
"organization": "dreidev"
},
"license": "LGPL",
"license": "MIT",
"bugs": {
"url": "https://github.com/dreidev/gitflow/issues"
},
"homepage": "https://github.com/dreidev/gitflow#readme",
"dependencies": {
"breakout-timeline": "0.0.4",
"commander": "^2.9.0",
"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