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
d44eaf90
Commit
d44eaf90
authored
Feb 16, 2010
by
Vincent Driessen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/compliance' into develop
parents
6d64d2c3
283b0f70
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
81 additions
and
81 deletions
+81
-81
git-flow
git-flow
+1
-1
git-flow-feature
git-flow-feature
+16
-16
git-flow-hotfix
git-flow-hotfix
+16
-16
git-flow-init
git-flow-init
+4
-4
git-flow-release
git-flow-release
+15
-15
git-flow-support
git-flow-support
+14
-14
gitflow-common
gitflow-common
+15
-15
No files found.
git-flow
View file @
d44eaf90
...
@@ -77,7 +77,7 @@ main() {
...
@@ -77,7 +77,7 @@ main() {
if
[
"
$1
"
!=
""
]
&&
!
echo
"
$1
"
|
grep
-q
"^-"
;
then
if
[
"
$1
"
!=
""
]
&&
!
echo
"
$1
"
|
grep
-q
"^-"
;
then
SUBACTION
=
"
$1
"
;
shift
SUBACTION
=
"
$1
"
;
shift
fi
fi
if
!
type
set
-f
"cmd_
$SUBACTION
"
2>&1
>
/dev/null
;
then
if
!
type
"cmd_
$SUBACTION
"
>
/dev/null 2>&1
;
then
warn
"Unknown subcommand: '
$SUBACTION
'"
warn
"Unknown subcommand: '
$SUBACTION
'"
usage
usage
exit
1
exit
1
...
...
git-flow-feature
View file @
d44eaf90
...
@@ -32,9 +32,9 @@ cmd_list() {
...
@@ -32,9 +32,9 @@ cmd_list() {
DEFINE_boolean verbose false 'verbose (more) output' v
DEFINE_boolean verbose false 'verbose (more) output' v
parse_args "$@"
parse_args "$@"
typeset
feature_branches
local
feature_branches
typeset
current_branch
local
current_branch
typeset
short_names
local
short_names
feature_branches=$(echo "$LOCAL_BRANCHES" | grep "^$PREFIX")
feature_branches=$(echo "$LOCAL_BRANCHES" | grep "^$PREFIX")
if [ -z "$feature_branches" ]; then
if [ -z "$feature_branches" ]; then
warn "No feature branches exist."
warn "No feature branches exist."
...
@@ -44,20 +44,20 @@ cmd_list() {
...
@@ -44,20 +44,20 @@ cmd_list() {
short_names=$(echo "$feature_branches" | sed "s ^$PREFIX g")
short_names=$(echo "$feature_branches" | sed "s ^$PREFIX g")
# determine column width first
# determine column width first
typeset -i
width=0
local
width=0
typeset
branch
local
branch
for branch in $short_names; do
for branch in $short_names; do
typeset -i
len=${#branch}
local
len=${#branch}
width=$(max $width $len)
width=$(max $width $len)
done
done
width=
width+3
width=
$(($width+3))
typeset
branch
local
branch
for branch in $short_names; do
for branch in $short_names; do
typeset
fullname=$PREFIX$branch
local
fullname=$PREFIX$branch
typeset
base=$(git merge-base "$fullname" "$DEVELOP_BRANCH")
local
base=$(git merge-base "$fullname" "$DEVELOP_BRANCH")
typeset
develop_sha=$(git rev-parse "$DEVELOP_BRANCH")
local
develop_sha=$(git rev-parse "$DEVELOP_BRANCH")
typeset
branch_sha=$(git rev-parse "$fullname")
local
branch_sha=$(git rev-parse "$fullname")
if [ "$fullname" = "$current_branch" ]; then
if [ "$fullname" = "$current_branch" ]; then
printf "* "
printf "* "
else
else
...
@@ -97,8 +97,8 @@ require_name_arg() {
...
@@ -97,8 +97,8 @@ require_name_arg() {
expand_nameprefix_arg() {
expand_nameprefix_arg() {
require_name_arg
require_name_arg
typeset
expanded_name
local
expanded_name
typeset -i
exitcode
local
exitcode
expanded_name=$(resolve_nameprefix "$NAME" "$PREFIX")
expanded_name=$(resolve_nameprefix "$NAME" "$PREFIX")
exitcode=$?
exitcode=$?
case $exitcode in
case $exitcode in
...
@@ -114,7 +114,7 @@ expand_nameprefix_arg_or_current() {
...
@@ -114,7 +114,7 @@ expand_nameprefix_arg_or_current() {
expand_nameprefix_arg
expand_nameprefix_arg
gitflow_require_branch "$PREFIX$NAME"
gitflow_require_branch "$PREFIX$NAME"
else
else
typeset
current_branch=$(gitflow_current_branch)
local
current_branch=$(gitflow_current_branch)
if startswith "$current_branch" "$PREFIX"; then
if startswith "$current_branch" "$PREFIX"; then
BRANCH=$current_branch
BRANCH=$current_branch
NAME=${BRANCH#$PREFIX}
NAME=${BRANCH#$PREFIX}
...
@@ -368,7 +368,7 @@ cmd_rebase() {
...
@@ -368,7 +368,7 @@ cmd_rebase() {
gitflow_require_branch "$BRANCH"
gitflow_require_branch "$BRANCH"
git checkout -q "$BRANCH"
git checkout -q "$BRANCH"
typeset
OPTS=
local
OPTS=
if flag interactive; then
if flag interactive; then
OPTS="$OPTS -i"
OPTS="$OPTS -i"
fi
fi
...
...
git-flow-hotfix
View file @
d44eaf90
...
@@ -29,9 +29,9 @@ cmd_list() {
...
@@ -29,9 +29,9 @@ cmd_list() {
DEFINE_boolean verbose false 'verbose (more) output' v
DEFINE_boolean verbose false 'verbose (more) output' v
parse_args "$@"
parse_args "$@"
typeset
hotfix_branches
local
hotfix_branches
typeset
current_branch
local
current_branch
typeset
short_names
local
short_names
hotfix_branches=$(echo "$LOCAL_BRANCHES" | grep "^$PREFIX")
hotfix_branches=$(echo "$LOCAL_BRANCHES" | grep "^$PREFIX")
if [ -z "$hotfix_branches" ]; then
if [ -z "$hotfix_branches" ]; then
warn "No hotfix branches exist."
warn "No hotfix branches exist."
...
@@ -41,20 +41,20 @@ cmd_list() {
...
@@ -41,20 +41,20 @@ cmd_list() {
short_names=$(echo "$hotfix_branches" | sed "s ^$PREFIX g")
short_names=$(echo "$hotfix_branches" | sed "s ^$PREFIX g")
# determine column width first
# determine column width first
typeset -i
width=0
local
width=0
typeset
branch
local
branch
for branch in $short_names; do
for branch in $short_names; do
typeset -i
len=${#branch}
local
len=${#branch}
width=$(max $width $len)
width=$(max $width $len)
done
done
width=
width+3
width=
$(($width+3))
typeset
branch
local
branch
for branch in $short_names; do
for branch in $short_names; do
typeset
fullname=$PREFIX$branch
local
fullname=$PREFIX$branch
typeset
base=$(git merge-base "$fullname" "$MASTER_BRANCH")
local
base=$(git merge-base "$fullname" "$MASTER_BRANCH")
typeset
master_sha=$(git rev-parse "$MASTER_BRANCH")
local
master_sha=$(git rev-parse "$MASTER_BRANCH")
typeset
branch_sha=$(git rev-parse "$fullname")
local
branch_sha=$(git rev-parse "$fullname")
if [ "$fullname" = "$current_branch" ]; then
if [ "$fullname" = "$current_branch" ]; then
printf "* "
printf "* "
else
else
...
@@ -65,8 +65,8 @@ cmd_list() {
...
@@ -65,8 +65,8 @@ cmd_list() {
if [ "$branch_sha" = "$master_sha" ]; then
if [ "$branch_sha" = "$master_sha" ]; then
printf "(no commits yet)"
printf "(no commits yet)"
else
else
typeset
tagname=$(git name-rev --tags --no-undefined --name-only "$base")
local
tagname=$(git name-rev --tags --no-undefined --name-only "$base")
typeset
nicename
local
nicename
if [ "$tagname" != "" ]; then
if [ "$tagname" != "" ]; then
nicename=$tagname
nicename=$tagname
else
else
...
@@ -193,9 +193,9 @@ cmd_finish() {
...
@@ -193,9 +193,9 @@ cmd_finish() {
# try to tag the release
# try to tag the release
# in case a previous attempt to finish this release branch has failed,
# in case a previous attempt to finish this release branch has failed,
# but the tag was set successful, we skip it now
# but the tag was set successful, we skip it now
typeset
tagname=$VERSION_PREFIX$VERSION
local
tagname=$VERSION_PREFIX$VERSION
if ! gitflow_tag_exists "$tagname"; then
if ! gitflow_tag_exists "$tagname"; then
typeset
opts="-a"
local
opts="-a"
flag sign && opts="$opts -s"
flag sign && opts="$opts -s"
[ "$FLAGS_signingkey" != "" ] && opts="$opts -u '$FLAGS_signingkey'"
[ "$FLAGS_signingkey" != "" ] && opts="$opts -u '$FLAGS_signingkey'"
[ "$FLAGS_message" != "" ] && opts="$opts -m '$FLAGS_message'"
[ "$FLAGS_message" != "" ] && opts="$opts -m '$FLAGS_message'"
...
...
git-flow-init
View file @
d44eaf90
...
@@ -21,12 +21,12 @@ cmd_default() {
...
@@ -21,12 +21,12 @@ cmd_default() {
echo
echo
echo "Summary of actions:"
echo "Summary of actions:"
if ! git rev-parse --git-dir
2>&1 >/dev/null
; then
if ! git rev-parse --git-dir
>/dev/null 2>&1
; then
git init --quiet
git init --quiet
echo "- A new git repository at $PWD was created"
echo "- A new git repository at $PWD was created"
fi
fi
if ! git rev-parse --quiet --verify HEAD
2>&1 >/dev/null
; then
if ! git rev-parse --quiet --verify HEAD
>/dev/null 2>&1
; then
touch "$README"
touch "$README"
git add "$README"
git add "$README"
git commit --quiet -m "initial commit"
git commit --quiet -m "initial commit"
...
@@ -36,7 +36,7 @@ cmd_default() {
...
@@ -36,7 +36,7 @@ cmd_default() {
echo "- An initial commit was created at branch '$MASTER_BRANCH'"
echo "- An initial commit was created at branch '$MASTER_BRANCH'"
fi
fi
if ! git rev-parse --verify "$MASTER_BRANCH"
2>&1 >/dev/null
; then
if ! git rev-parse --verify "$MASTER_BRANCH"
>/dev/null 2>&1
; then
die "Cannot find your master branch. Try: git branch -m <mymaster> $MASTER_BRANCH"
die "Cannot find your master branch. Try: git branch -m <mymaster> $MASTER_BRANCH"
fi
fi
...
@@ -47,7 +47,7 @@ cmd_default() {
...
@@ -47,7 +47,7 @@ cmd_default() {
gitflow_require_branches_equal "$MASTER_BRANCH" "$ORIGIN/$MASTER_BRANCH"
gitflow_require_branches_equal "$MASTER_BRANCH" "$ORIGIN/$MASTER_BRANCH"
fi
fi
if git rev-parse --verify "$DEVELOP_BRANCH"
2>&1 >/dev/null
; then
if git rev-parse --verify "$DEVELOP_BRANCH"
>/dev/null 2>&1
; then
gitflow_require_branches_equal "$DEVELOP_BRANCH" "$ORIGIN/$DEVELOP_BRANCH"
gitflow_require_branches_equal "$DEVELOP_BRANCH" "$ORIGIN/$DEVELOP_BRANCH"
else
else
git checkout -q -b "$DEVELOP_BRANCH" "$MASTER_BRANCH"
git checkout -q -b "$DEVELOP_BRANCH" "$MASTER_BRANCH"
...
...
git-flow-release
View file @
d44eaf90
...
@@ -40,9 +40,9 @@ cmd_list() {
...
@@ -40,9 +40,9 @@ cmd_list() {
DEFINE_boolean verbose false 'verbose (more) output' v
DEFINE_boolean verbose false 'verbose (more) output' v
parse_args "$@"
parse_args "$@"
typeset
release_branches
local
release_branches
typeset
current_branch
local
current_branch
typeset
short_names
local
short_names
release_branches=$(echo "$LOCAL_BRANCHES" | grep "^$PREFIX")
release_branches=$(echo "$LOCAL_BRANCHES" | grep "^$PREFIX")
if [ -z "$release_branches" ]; then
if [ -z "$release_branches" ]; then
warn "No release branches exist."
warn "No release branches exist."
...
@@ -53,20 +53,20 @@ cmd_list() {
...
@@ -53,20 +53,20 @@ cmd_list() {
short_names=$(echo "$release_branches" | sed "s ^$PREFIX g")
short_names=$(echo "$release_branches" | sed "s ^$PREFIX g")
# determine column width first
# determine column width first
typeset -i
width=0
local
width=0
typeset
branch
local
branch
for branch in $short_names; do
for branch in $short_names; do
typeset -i
len=${#branch}
local
len=${#branch}
width=$(max $width $len)
width=$(max $width $len)
done
done
width=
width+3
width=
$(($width+3))
typeset
branch
local
branch
for branch in $short_names; do
for branch in $short_names; do
typeset
fullname=$PREFIX$branch
local
fullname=$PREFIX$branch
typeset
base=$(git merge-base "$fullname" "$DEVELOP_BRANCH")
local
base=$(git merge-base "$fullname" "$DEVELOP_BRANCH")
typeset
develop_sha=$(git rev-parse "$DEVELOP_BRANCH")
local
develop_sha=$(git rev-parse "$DEVELOP_BRANCH")
typeset
branch_sha=$(git rev-parse "$fullname")
local
branch_sha=$(git rev-parse "$fullname")
if [ "$fullname" = "$current_branch" ]; then
if [ "$fullname" = "$current_branch" ]; then
printf "* "
printf "* "
else
else
...
@@ -77,7 +77,7 @@ cmd_list() {
...
@@ -77,7 +77,7 @@ cmd_list() {
if [ "$branch_sha" = "$develop_sha" ]; then
if [ "$branch_sha" = "$develop_sha" ]; then
printf "(no commits yet)"
printf "(no commits yet)"
else
else
typeset
nicename=$(git rev-parse --short "$base")
local
nicename=$(git rev-parse --short "$base")
printf "(based on $nicename)"
printf "(based on $nicename)"
fi
fi
else
else
...
@@ -199,9 +199,9 @@ cmd_finish() {
...
@@ -199,9 +199,9 @@ cmd_finish() {
# try to tag the release
# try to tag the release
# in case a previous attempt to finish this release branch has failed,
# in case a previous attempt to finish this release branch has failed,
# but the tag was set successful, we skip it now
# but the tag was set successful, we skip it now
typeset
tagname=$VERSION_PREFIX$VERSION
local
tagname=$VERSION_PREFIX$VERSION
if ! gitflow_tag_exists "$tagname"; then
if ! gitflow_tag_exists "$tagname"; then
typeset
opts="-a"
local
opts="-a"
flag sign && opts="$opts -s"
flag sign && opts="$opts -s"
[ "$FLAGS_signingkey" != "" ] && opts="$opts -u '$FLAGS_signingkey'"
[ "$FLAGS_signingkey" != "" ] && opts="$opts -u '$FLAGS_signingkey'"
[ "$FLAGS_message" != "" ] && opts="$opts -m '$FLAGS_message'"
[ "$FLAGS_message" != "" ] && opts="$opts -m '$FLAGS_message'"
...
...
git-flow-support
View file @
d44eaf90
...
@@ -31,9 +31,9 @@ cmd_list() {
...
@@ -31,9 +31,9 @@ cmd_list() {
DEFINE_boolean verbose false 'verbose (more) output' v
DEFINE_boolean verbose false 'verbose (more) output' v
parse_args "$@"
parse_args "$@"
typeset
support_branches
local
support_branches
typeset
current_branch
local
current_branch
typeset
short_names
local
short_names
support_branches=$(echo "$LOCAL_BRANCHES" | grep "^$PREFIX")
support_branches=$(echo "$LOCAL_BRANCHES" | grep "^$PREFIX")
if [ -z "$support_branches" ]; then
if [ -z "$support_branches" ]; then
warn "No support branches exist."
warn "No support branches exist."
...
@@ -43,20 +43,20 @@ cmd_list() {
...
@@ -43,20 +43,20 @@ cmd_list() {
short_names=$(echo "$support_branches" | sed "s ^$PREFIX g")
short_names=$(echo "$support_branches" | sed "s ^$PREFIX g")
# determine column width first
# determine column width first
typeset -i
width=0
local
width=0
typeset
branch
local
branch
for branch in $short_names; do
for branch in $short_names; do
typeset -i
len=${#branch}
local
len=${#branch}
width=$(max $width $len)
width=$(max $width $len)
done
done
width=
width+3
width=
$(($width+3))
typeset
branch
local
branch
for branch in $short_names; do
for branch in $short_names; do
typeset
fullname=$PREFIX$branch
local
fullname=$PREFIX$branch
typeset
base=$(git merge-base "$fullname" "$MASTER_BRANCH")
local
base=$(git merge-base "$fullname" "$MASTER_BRANCH")
typeset
master_sha=$(git rev-parse "$MASTER_BRANCH")
local
master_sha=$(git rev-parse "$MASTER_BRANCH")
typeset
branch_sha=$(git rev-parse "$fullname")
local
branch_sha=$(git rev-parse "$fullname")
if [ "$fullname" = "$current_branch" ]; then
if [ "$fullname" = "$current_branch" ]; then
printf "* "
printf "* "
else
else
...
@@ -67,8 +67,8 @@ cmd_list() {
...
@@ -67,8 +67,8 @@ cmd_list() {
if [ "$branch_sha" = "$master_sha" ]; then
if [ "$branch_sha" = "$master_sha" ]; then
printf "(no commits yet)"
printf "(no commits yet)"
else
else
typeset
tagname=$(git name-rev --tags --no-undefined --name-only "$base")
local
tagname=$(git name-rev --tags --no-undefined --name-only "$base")
typeset
nicename
local
nicename
if [ "$tagname" != "" ]; then
if [ "$tagname" != "" ]; then
nicename=$tagname
nicename=$tagname
else
else
...
...
gitflow-common
View file @
d44eaf90
...
@@ -18,7 +18,7 @@ die() { warn "$@"; exit 1; }
...
@@ -18,7 +18,7 @@ die() { warn "$@"; exit 1; }
# set logic
# set logic
has() {
has() {
typeset
item=$1; shift
local
item=$1; shift
echo " $@ " | grep -q " $item "
echo " $@ " | grep -q " $item "
}
}
...
@@ -31,8 +31,8 @@ startswith() { [ "$1" != "${1#$2}" ]; }
...
@@ -31,8 +31,8 @@ startswith() { [ "$1" != "${1#$2}" ]; }
endswith() { [ "$1" != "${1#$2}" ]; }
endswith() { [ "$1" != "${1#$2}" ]; }
# convenience functions for checking shFlags flags
# convenience functions for checking shFlags flags
flag() {
typeset
FLAG; eval FLAG='$FLAGS_'$1; [ $FLAG -eq $FLAGS_TRUE ]; }
flag() {
local
FLAG; eval FLAG='$FLAGS_'$1; [ $FLAG -eq $FLAGS_TRUE ]; }
noflag() {
typeset
FLAG; eval FLAG='$FLAGS_'$1; [ $FLAG -ne $FLAGS_TRUE ]; }
noflag() {
local
FLAG; eval FLAG='$FLAGS_'$1; [ $FLAG -ne $FLAGS_TRUE ]; }
#
#
# Git specific common functionality
# Git specific common functionality
...
@@ -61,10 +61,10 @@ ALL_TAGS=$(git tag)
...
@@ -61,10 +61,10 @@ ALL_TAGS=$(git tag)
# 2: Multiple matches found. These matches are written to stderr
# 2: Multiple matches found. These matches are written to stderr
#
#
resolve_nameprefix() {
resolve_nameprefix() {
typeset
name=$1
local
name=$1
typeset
prefix=$2
local
prefix=$2
typeset
matches
local
matches
typeset -i
num_matches
local
num_matches
# first, check if there is a perfect match
# first, check if there is a perfect match
if has "$LOCAL_BRANCHES" "$prefix$name"; then
if has "$LOCAL_BRANCHES" "$prefix$name"; then
...
@@ -109,7 +109,7 @@ gitflow_test_clean_working_tree() {
...
@@ -109,7 +109,7 @@ gitflow_test_clean_working_tree() {
gitflow_require_clean_working_tree() {
gitflow_require_clean_working_tree() {
gitflow_test_clean_working_tree
gitflow_test_clean_working_tree
typeset -i
result=$?
local
result=$?
if [ $result -eq 1 ]; then
if [ $result -eq 1 ]; then
die "fatal: Working tree contains unstaged changes. Aborting."
die "fatal: Working tree contains unstaged changes. Aborting."
fi
fi
...
@@ -164,10 +164,10 @@ gitflow_tag_exists() {
...
@@ -164,10 +164,10 @@ gitflow_tag_exists() {
# 3 Branch needs a real merge
# 3 Branch needs a real merge
#
#
gitflow_test_branches_equal() {
gitflow_test_branches_equal() {
typeset
commit1=$(git rev-parse "$1")
local
commit1=$(git rev-parse "$1")
typeset
commit2=$(git rev-parse "$2")
local
commit2=$(git rev-parse "$2")
if [ "$commit1" != "$commit2" ]; then
if [ "$commit1" != "$commit2" ]; then
typeset
base=$(git merge-base "$commit1" "$commit2")
local
base=$(git merge-base "$commit1" "$commit2")
if [ "$commit1" = "$base" ]; then
if [ "$commit1" = "$base" ]; then
return 1
return 1
elif [ "$commit2" = "$base" ]; then
elif [ "$commit2" = "$base" ]; then
...
@@ -184,7 +184,7 @@ gitflow_require_branches_equal() {
...
@@ -184,7 +184,7 @@ gitflow_require_branches_equal() {
gitflow_require_local_branch "$1"
gitflow_require_local_branch "$1"
gitflow_require_remote_branch "$2"
gitflow_require_remote_branch "$2"
gitflow_test_branches_equal "$1" "$2"
gitflow_test_branches_equal "$1" "$2"
typeset -i
status=$?
local
status=$?
if [ $status -gt 0 ]; then
if [ $status -gt 0 ]; then
warn "Branches '$1' and '$2' have diverged."
warn "Branches '$1' and '$2' have diverged."
if [ $status -eq 1 ]; then
if [ $status -eq 1 ]; then
...
@@ -204,8 +204,8 @@ gitflow_require_branches_equal() {
...
@@ -204,8 +204,8 @@ gitflow_require_branches_equal() {
# Checks whether branch $1 is succesfully merged into $2
# Checks whether branch $1 is succesfully merged into $2
#
#
gitflow_is_branch_merged_into() {
gitflow_is_branch_merged_into() {
typeset
subject=$1
local
subject=$1
typeset
base=$2
local
base=$2
typeset
all_merges=$(git branch --contains $subject | sed 's/^[* ] //')
local
all_merges=$(git branch --contains $subject | sed 's/^[* ] //')
has $base $all_merges
has $base $all_merges
}
}
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