Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitflow
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tools
gitflow
Commits
605b7cd8
Commit
605b7cd8
authored
Jan 26, 2010
by
Vincent Driessen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Functionally implement the gitflow-hotfix subcommand.
parent
696b9eb8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
11 deletions
+44
-11
gitflow-hotfix
gitflow-hotfix
+44
-11
No files found.
gitflow-hotfix
View file @
605b7cd8
...
...
@@ -15,12 +15,22 @@
usage
()
{
echo
"usage: gitflow start hotfix <release>"
echo
" gitflow finish hotfix <release>"
# TODO
#echo ""
#echo "options:"
#echo "--option Explanation"
#echo ""
#echo "start-only options:"
#echo "--option Explanation"
#echo ""
#echo "finish-only options:"
#echo "--push Push to the origin repo when finished"
}
parse_args
()
{
RELEASE
=
"
$1
"
if
[
"
$RELEASE
"
=
""
]
;
then
echo
"Missing argument <release>
.
"
echo
"Missing argument <release>"
usage
exit
1
fi
...
...
@@ -36,8 +46,19 @@ start() {
gitflow_require_branch_absent
"
$HOTFIX_BRANCH
"
# All checks passed, ready to roll
echo
"git checkout -b
\"
$HOTFIX_BRANCH
\"
master"
echo
"Don't forget to bump the version number now."
git checkout
-b
"
$HOTFIX_BRANCH
"
master
echo
""
echo
"Summary of actions:"
echo
"- A new branch '
$HOTFIX_BRANCH
' was created, based on 'master'"
echo
"- You are now on branch '
$HOTFIX_BRANCH
'"
echo
""
echo
"Follow-up actions:"
echo
"- Bump the version number now!"
echo
"- Start committing your hot fixes"
echo
"- When done, run:"
echo
""
echo
" gitflow finish hotfix '
$HOTFIX_BRANCH
'"
}
finish
()
{
...
...
@@ -46,17 +67,29 @@ finish() {
# Checks
gitflow_check_clean_working_tree
echo
"git fetch origin"
git fetch origin
git fetch origin develop
# TODO: Make a flag to skip these fetches
git fetch origin
master
# TODO: Make a flag to skip these fetches
gitflow_require_branches_equal
'master'
'origin/master'
gitflow_require_branches_equal
'develop'
'origin/develop'
# All checks passed, ready to roll
echo
"git checkout master"
echo
"git merge --no-ff
\"
$HOTFIX_BRANCH
\"
"
echo
"git tag
\"
$RELEASE
\"
"
echo
"git checkout develop"
echo
"git merge --no-ff
\"
$HOTFIX_BRANCH
\"
"
echo
"git branch -d
\"
$HOTFIX_BRANCH
\"
"
git checkout master
git merge
--no-ff
"
$HOTFIX_BRANCH
"
git tag
"
$RELEASE
"
git checkout develop
git merge
--no-ff
"
$HOTFIX_BRANCH
"
git branch
-d
"
$HOTFIX_BRANCH
"
# TODO: Implement an optional push to master
# git push origin develop; git push origin master; git push --tags origin
echo
""
echo
"Summary of actions:"
echo
"- Latest objects have been fetched from 'origin'"
echo
"- Hotfix branch has been merged into 'master'"
echo
"- The hotfix was tagged '
$RELEASE
'"
echo
"- Hotfix branch has been back-merged into 'develop'"
echo
"- Hotfix branch '
$HOTFIX_BRANCH
' has been deleted"
echo
""
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment