Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
9ba559f
Support Git Environment Credentials
filipekiss Mar 27, 2019
a11f64d
<fix>(git-glow-log): fixed help message
Shea690901 Jun 27, 2021
15a336a
git-flow: prefer "-f" readlink(1) option to "-e"
Dec 8, 2021
2ae8009
chore(release): tag 'v2.1.0' into develop
ChrisJStone Jul 1, 2023
5185400
Merge pull request #12 from KAction/readlink-busybox
ChrisJStone Jul 3, 2023
8288f7d
Merge pull request #15 from Shea690901/hotfix/git-flow-log_help-message
ChrisJStone Jul 3, 2023
0d5c72e
Merge pull request #19 from filipekiss/feature/environment_credentials
ChrisJStone Jul 3, 2023
362561e
docs: update copyright information in source files
ChrisJStone Jul 4, 2023
e2098dc
docs: update repository url in source files
ChrisJStone Jul 4, 2023
89095b2
Revert "Support Git Environment Credentials"
ChrisJStone Jul 4, 2023
f7ae4ba
Merge pull request #60 from CJ-Systems/revert-19-feature/environment_…
ChrisJStone Jul 4, 2023
c8f82ad
Merge pull request #3 from filipekiss/feature/environment_credentials
ChrisJStone Jul 4, 2023
2b5a61a
Merge branch 'CJ-Systems:develop' into develop
ChrisJStone Jul 4, 2023
1d1cd23
Merge pull request #61 from ChrisJStone/develop
ChrisJStone Jul 4, 2023
18b05aa
feat(init): add sign flag to create signed commit
ChrisJStone Jul 4, 2023
5f5b6c2
Merge branch 'feature/intial_signed_commit' into develop
ChrisJStone Jul 4, 2023
b5db30e
Merge branch 'CJ-Systems:develop' into develop
ChrisJStone Jul 4, 2023
48596d7
Merge pull request #62 from ChrisJStone/develop
ChrisJStone Jul 4, 2023
8e703e0
a quick option to create release from existing feature branch
codesurf42 May 16, 2014
cfb08d7
feat(feature): add help for release command
ChrisJStone Jul 5, 2023
d73ef0a
feat(feature): add release sub command
ChrisJStone Jul 5, 2023
1589eaa
chore(version): update snapshot version
ChrisJStone Jul 5, 2023
413277d
docs(changelog): add current changes
ChrisJStone Jul 5, 2023
aae1608
core(release): add release notes to changelog
ChrisJStone Jul 5, 2023
c322458
feat(feature): add feature release command (#64)
ChrisJStone Jul 5, 2023
4a2be44
Prevent hotfixes being merged to develop with nobackmerge flag, fixes…
adamrodger Nov 6, 2018
b5fa210
fix: Prevent hotfixes being merged to develop with nobackmerge flag (…
ChrisJStone Jul 5, 2023
1d729c6
docs(changelog): update changelog
ChrisJStone Jul 5, 2023
070b92c
Prevent hotfixes being merged to develop with nobackmerge flag, fixes…
adamrodger Nov 6, 2018
76fb09a
feat(hotfix): add backmerge release
Aug 6, 2019
830156f
Merge branch 'develop' into feature/back_merge_hot_fix_to_release
ChrisJStone Jul 5, 2023
4c86238
feat(hotfix): add backmerge option to release branch (#71)
ChrisJStone Jul 5, 2023
25c387c
fix: branch existence checks
ChrisJStone Jul 6, 2023
ca6828e
feat: add cherrypick option to hotfix finish (#73)
ChrisJStone Jul 6, 2023
e337c88
docs(changelog): add release notes
ChrisJStone Jul 6, 2023
2eed4b5
chore(release): release version 2.2.0
ChrisJStone Jul 6, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,23 @@
# Changelog

#### 2.2.0
* feat(init): add option to sign initial commit (#59)
* feat(git-flow): add support for environment credentials (#19)
* feat(git-flow): add support for busybox(#12)
* feat(feature): add feature release command (#64)
* feat(hotfix): add cherrypick option to hotfix finish (#73)
* feat(hotfix): add backmerge option to release branch (#71)
* fix(hotfix): git flow hotfix finish -b still back-merges to develop (#66)
* fix(hotfix): git flow hotfix track fails due to branch name check (#68)
* fix: git flow log help message (#15)

#### 2.1.0
* feat: add create command to release allowing for a single step release prodution
* feat: add missing hook script filter-flow-release-finish-version
* fix: multi-line tag message when using -m
* docs: update readme with better description as to why this fork was created. Thank You [shaedrick](https://github.com/shaedrich)
**NOTE:** The format for a multi-line tag message is now "$(printf 'line of text with \n escape codes placed as needed for proper formating of the message')"


#### 2.0.1
* fix incorrect version identification along with updating source repository in gitflow-installer. Corrections pointed out by [bobstuart](https://github.com/bobstuart)

Expand Down
5 changes: 3 additions & 2 deletions git-flow
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@
# http://blog.avirtualhome.com/development-workflow-using-git/
#
# Feel free to contribute to this project at:
# http://github.com/petervanderdoes/gitflow
# http://github.com/CJ-Systems/gitflow-cjs
#
# Authors:
# Copyright 2003 CJ Systems. All rights reserved.
# Copyright 2012-2019 Peter van der Does. All rights reserved.
#
# Original Author:
Expand Down Expand Up @@ -46,7 +47,7 @@ fi
# git-flow file is a symbolic link
case $(uname -s) in
Linux)
export GITFLOW_DIR=$(dirname "$(readlink -e "$0")")
export GITFLOW_DIR=$(dirname "$(readlink -f "$0")")
;;
FreeBSD|OpenBSD|NetBSD)
export FLAGS_GETOPT_CMD='/usr/local/bin/getopt'
Expand Down
3 changes: 2 additions & 1 deletion git-flow-bugfix
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
# http://blog.avirtualhome.com/development-workflow-using-git/
#
# Feel free to contribute to this project at:
# http://github.com/petervanderdoes/gitflow
# http://github.com/CJ-Systems/gitflow-cjs
#
# Authors:
# Copyright 2003 CJ Systems. All rights reserved.
# Copyright 2012-2019 Peter van der Does. All rights reserved.
#
# Original Author:
Expand Down
3 changes: 2 additions & 1 deletion git-flow-config
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
# http://blog.avirtualhome.com/development-workflow-using-git/
#
# Feel free to contribute to this project at:
# http://github.com/petervanderdoes/gitflow
# http://github.com/CJ-Systems/gitflow-cjs
#
# Authors:
# Copyright 2003 CJ Systems. All rights reserved.
# Copyright 2012-2019 Peter van der Does. All rights reserved.
#
#
Expand Down
34 changes: 33 additions & 1 deletion git-flow-feature
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
# http://blog.avirtualhome.com/development-workflow-using-git/
#
# Feel free to contribute to this project at:
# http://github.com/petervanderdoes/gitflow
# http://github.com/CJ-Systems/gitflow-cjs
#
# Authors:
# Copyright 2003 CJ Systems. All rights reserved.
# Copyright 2012-2019 Peter van der Does. All rights reserved.
#
# Original Author:
Expand Down Expand Up @@ -58,6 +59,7 @@ git flow feature checkout
git flow feature pull
git flow feature delete
git flow feature rename
git flow feature release

Manage your feature branches.

Expand Down Expand Up @@ -429,6 +431,36 @@ no-ff! Never fast-forward during the merge
helper_finish_cleanup
}

cmd_release() {
OPTIONS_SPEC="\
git flow feature release [-h]

Create a release based on current feature
--
h,help! Show this help
"

# 1) pull dev from origin
# git_do checkout "$BRANCH"
# git_do (or somth exists alredy here?)

# Parse arguments
parse_args "$@"

# Use current branch if no name is given
if [ "$NAME" = "" ]; then
gitflow_use_current_branch_name
fi

# 2) Update feature with dev
echo "Rebasing $BASE_BRANCH to $BRANCH"
git_do flow feature rebase || die "Could not rebase $BRANCH which is based on $BASE_BRANCH"

# 3) create release
git_do flow release start $NAME $BRANCH

}

helper_finish_cleanup() {
local keepmsg remotebranchdeleted localbranchdeleted

Expand Down
177 changes: 130 additions & 47 deletions git-flow-hotfix
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
# http://blog.avirtualhome.com/development-workflow-using-git/
#
# Feel free to contribute to this project at:
# http://github.com/petervanderdoes/gitflow
# http://github.com/CJ-Systems/gitflow-cjs
#
# Authors:
# Copyright 2003 CJ Systems. All rights reserved.
# Copyright 2012-2019 Peter van der Does. All rights reserved.
#
# Original Author:
Expand Down Expand Up @@ -348,23 +349,24 @@ showcommands! Show git commands while executing them

# Sanity checks
require_clean_working_tree
require_branch_absent "$BRANCH"
git_do fetch -q "$ORIGIN"
require_branch "$ORIGIN/$BRANCH"
require_local_branch_absent "$BRANCH"

git_do fetch -q "$ORIGIN" || die "Could not fetch branch '$BRANCH' from remote '$ORIGIN'."
git_remote_branch_exists "$ORIGIN/$BRANCH"

# Create tracking branch
git_do checkout -b "$BRANCH" "$ORIGIN/$BRANCH"
git_do checkout -b "$BRANCH" "$ORIGIN/$BRANCH" || die "Could not create branch '$BRANCH'."

echo
echo "Summary of actions:"
echo "- A new remote tracking branch '$BRANCH' was created"
echo "- You are now on branch '$BRANCH'"
echo "- You are now on branch '$(git_current_branch)'"
echo
}

cmd_finish() {
OPTIONS_SPEC="\
git flow hotfix finish [-h] [-F] [-s] [-u] [-m | -f ] [-p] [-k] [-n] [-b] [-S] <version>
git flow hotfix finish [-h] [-F] [-s] [-u] [-m | -f ] [-p] [-k] [-n] [-b | -c | -r] [-S] <version>

Finish hotfix branch <version>
--
Expand All @@ -382,8 +384,10 @@ k,[no]keep Keep branch after performing finish
D,[no]force_delete Force delete hotfix branch after finish
n,[no]notag Don't tag this hotfix
b,[no]nobackmerge Don't back-merge master, or tag if applicable, in develop
r,releaseBackmerge Back-merge to release branch if exists
S,[no]squash Squash hotfix during merge
T,tagname! Use given tag name
c,cherrypick Cherry Pick to $DEVELOP_BRANCH instead of merge
"
local opts commit keepmsg remotebranchdeleted localbranchdeleted

Expand All @@ -400,25 +404,29 @@ T,tagname! Use given tag name
DEFINE_boolean 'force_delete' false "force delete hotfix branch after finish" D
DEFINE_boolean 'notag' false "don't tag this hotfix" n
DEFINE_boolean 'nobackmerge' false "don't back-merge $MASTER_BRANCH, or tag if applicable, in $DEVELOP_BRANCH " b
DEFINE_boolean 'releasebackmerge' false "back-merge to release branch if exists" r
DEFINE_boolean 'squash' false "squash release during merge" S
DEFINE_boolean 'squash-info' false "add branch info during squash"
DEFINE_string 'tagname' "" "use the given tag name" T
DEFINE_boolean 'cherrypick' false "Cherry Pick to $DEVELOP_BRANCH instead of merge" c

# Override defaults with values from config
gitflow_override_flag_boolean "hotfix.finish.fetch" "fetch"
gitflow_override_flag_boolean "hotfix.finish.sign" "sign"
gitflow_override_flag_boolean "hotfix.finish.push" "push"
gitflow_override_flag_boolean "hotfix.finish.keep" "keep"
gitflow_override_flag_boolean "hotfix.finish.keepremote" "keepremote"
gitflow_override_flag_boolean "hotfix.finish.keeplocal" "keeplocal"
gitflow_override_flag_boolean "hotfix.finish.force-delete" "force_delete"
gitflow_override_flag_boolean "hotfix.finish.notag" "notag"
gitflow_override_flag_boolean "hotfix.finish.nobackmerge" "nobackmerge"
gitflow_override_flag_boolean "hotfix.finish.squash" "squash"
gitflow_override_flag_boolean "hotfix.finish.squash-info" "squash_info"
gitflow_override_flag_string "hotfix.finish.signingkey" "signingkey"
gitflow_override_flag_string "hotfix.finish.message" "message"
gitflow_override_flag_string "hotfix.finish.messagefile" "messagefile"
gitflow_override_flag_boolean "hotfix.finish.fetch" "fetch"
gitflow_override_flag_boolean "hotfix.finish.sign" "sign"
gitflow_override_flag_boolean "hotfix.finish.push" "push"
gitflow_override_flag_boolean "hotfix.finish.keep" "keep"
gitflow_override_flag_boolean "hotfix.finish.keepremote" "keepremote"
gitflow_override_flag_boolean "hotfix.finish.keeplocal" "keeplocal"
gitflow_override_flag_boolean "hotfix.finish.force-delete" "force_delete"
gitflow_override_flag_boolean "hotfix.finish.notag" "notag"
gitflow_override_flag_boolean "hotfix.finish.nobackmerge" "nobackmerge"
gitflow_override_flag_boolean "hotfix.finish.releasebackmerge" "releasebackmerge"
gitflow_override_flag_boolean "hotfix.finish.squash" "squash"
gitflow_override_flag_boolean "hotfix.finish.squash-info" "squash_info"
gitflow_override_flag_string "hotfix.finish.signingkey" "signingkey"
gitflow_override_flag_string "hotfix.finish.message" "message"
gitflow_override_flag_string "hotfix.finish.messagefile" "messagefile"
gitflow_override_flag_boolean "hotfix.finish.cherrypick" "cherrypick"

# Parse arguments
parse_args "$@"
Expand Down Expand Up @@ -448,6 +456,19 @@ T,tagname! Use given tag name
FLAGS_keep=$FLAGS_TRUE
fi

# Check that not both no merge flags were given
if flag cherrypick && flag nobackmerge; then
die "You can't use 'cherrypick' and 'nobackmerge' together."
fi

if flag cherrypick && flag releasebackmerge; then
die "You can't use 'cherrypick' and 'releasebackmerge' together."
fi

if flag nobackmerge && flag releasebackmerge; then
die "You can't use 'nobackmerge' && 'releasebackmerge' together."
fi

# Sanity checks
require_branch "$BRANCH"
require_clean_working_tree
Expand Down Expand Up @@ -516,6 +537,42 @@ T,tagname! Use given tag name

run_pre_hook "$VERSION_PREFIX$TAGNAME" "$ORIGIN" "$BRANCH"

if flag cherrypick; then
printf 'this is the cherrypick\n'
read
git_do checkout "$DEVELOP_BRANCH" || die "Could not check out branch '$DEVELOP_BRANCH'."

local old_IFS=$IFS # save the field separator
IFS=$'\n' # new field separator, the end of line
for git_line in $(git log --format="%H %s" --reverse $MASTER_BRANCH..$BRANCH | grep -vE "^[a-z0-9]* Merge branch '[^'].*?'$"); do
local commit_hash=$(echo $git_line | cut -d" " -f1)
if [[ $(git log $DEVELOP_BRANCH --grep "$commit_hash" | wc -l) -eq 0 ]]; then
echo "\n${LIGHTGREEN}Cherry picking: $git_line${NOCOLOR}"
git_do cherry-pick -x -s $commit_hash
if [[ $? -ne 0 ]]; then
echo "
===============================================================
= Cherry pick has conflicts, steps to continue:
= 1. Fix the conflicts
= 2. Stage the fixed file: '${BLUE}git add <file names>${NOCOLOR}'
= 3. Continue the cherry pick: '${BLUE}git cherry-pick --continue${NOCOLOR}'
= *** If fixing the conflict results in an empty commit,
= you will need to run this command: '${BLUE}git commit --allow-empty${NOCOLOR}'
= 4. Switch back to the hotfix branch: '${BLUE}git checkout $BRANCH${NOCOLOR}'
= 5. Rerun the finish command: '${BLUE}git flow hotfix finish${NOCOLOR}'
= OR run '${BLUE}git cherry-pick --abort${NOCOLOR}' to abort the cherry pick
===============================================================\n"
die "Cherry pick failed for commit: $commit_hash"
fi
else
echo "\n${LIGHTGREEN}Commit has already been Cherry Picked: $git_line${NOCOLOR}"
fi
done
IFS=$old_IFS # restore default field separator

git_do checkout $BRANCH || die "Could not check out branch '$BRANCH'."
fi

# Try to merge into BASE.
# In case a previous attempt to finish this release branch has failed,
# but the merge into BASE was successful, we skip it now
Expand Down Expand Up @@ -551,44 +608,66 @@ T,tagname! Use given tag name
fi
fi

if [ "$BASE_BRANCH" = "$MASTER_BRANCH" ]; then
# By default we back-merge the $MASTER_BRANCH unless the user explicitly
# stated not to do a back-merge, in that case we use the $BRANCH.
if noflag nobackmerge; then
MERGE_BRANCH="$BASE_BRANCH"
else
MERGE_BRANCH="$BRANCH"
fi

# Try to merge into develop.
if [ "$BASE_BRANCH" = "$MASTER_BRANCH" ] && noflag nobackmerge && noflag cherrypick; then
# Try to merge into develop unless the user specified the nobackmerge option.
# In case a previous attempt to finish this release branch has failed,
# but the merge into develop was successful, we skip it now
if ! git_is_branch_merged_into "$MERGE_BRANCH" "$DEVELOP_BRANCH"; then
if ! git_is_branch_merged_into "$BASE_BRANCH" "$DEVELOP_BRANCH"; then
# Accounting for 'git describe', if a release is tagged
# we use the tag commit instead of the branch.
if noflag notag; then
commit="$VERSION_PREFIX$TAGNAME"
else
commit="$BASE_BRANCH"
fi
# merge master to develop
git_do checkout "$DEVELOP_BRANCH" || die "Could not check out branch '$DEVELOP_BRANCH'."
git_do merge --no-ff "$commit" || die "There were merge conflicts." # TODO: What do we do now?
fi
fi

if noflag nobackmerge; then
# Accounting for 'git describe', if a release is tagged
# we use the tag commit instead of the branch.
if noflag notag; then
commit="$VERSION_PREFIX$TAGNAME"
else
commit="$BASE_BRANCH"
fi
if flag releasebackmerge; then
_releasePrefix=$(git config --get gitflow.prefix.release)
release_branches=$(git_local_branches_prefixed "$_releasePrefix")
release_branch=
# Check if there is a release branch
if [ -n "$release_branches" ]; then
# Get the release branch name
release_branch=$(echo ${release_branches} | head -n1)
# Check if release branch exists on remote
if git_remote_branch_exists "$ORIGIN/$release_branch"; then
# Try to merge into release.
# In case a previous attempt to finish this release branch has failed,
# but the merge into release was successful, we skip it now
if ! git_is_branch_merged_into "$MERGE_BRANCH" "$release_branch"; then
git_do checkout "$release_branch" || die "Could not check out branch '$release_branch'."
# Accounting for 'git describe', if a release is tagged
# we use the tag commit instead of the branch.
if noflag notag; then
commit="$VERSION_PREFIX$TAGNAME"
else
commit="$BASE_BRANCH"
fi
else
commit="$BRANCH"
fi
git_do merge --no-ff "$commit" || die "There were merge conflicts."
# TODO: What do we do now?
else
commit="$BRANCH"
echo "Remote release $release_branch not found"
fi

git_do merge --no-ff "$commit" || die "There were merge conflicts."
# TODO: What do we do now?
fi
fi
fi

run_post_hook "$VERSION_PREFIX$TAGNAME" "$ORIGIN" "$BRANCH"

if flag push; then
if [ "$BASE_BRANCH" = "$MASTER_BRANCH" ]; then
git_do push "$ORIGIN" "$DEVELOP_BRANCH" || die "Could not push branch '$DEVELOP_BRANCH' to remote '$ORIGIN'."
fi
if [ -n "$release_branch" ]; then
git_do push "$ORIGIN" "$release_branch" || dir "Could not push branch '$release_branch' to remote '$ORIGIN'."
fi
git_do push "$ORIGIN" "$BASE_BRANCH" || die "Could not push branch '$BASE_BRANCH' to remote '$ORIGIN'."
if noflag notag; then
git_do push --tags "$ORIGIN" || die "Could not push tags to remote '$ORIGIN'."
Expand Down Expand Up @@ -633,11 +712,15 @@ T,tagname! Use given tag name
if noflag notag; then
echo "- The hotfix was tagged '$VERSION_PREFIX$TAGNAME'"
fi
if [ "$BASE_BRANCH" = "$MASTER_BRANCH" ]; then
if flag cherrypick; then
echo "- All commits from the hotfix branch have been cherry picked into '$DEVELOP_BRANCH'"
elif [ "$BASE_BRANCH" = "$MASTER_BRANCH" ]; then
[ "$commit" = "$BASE_BRANCH" ] && echo "- Master branch '$BASE_BRANCH' has been back-merged into '$DEVELOP_BRANCH'"
[ "$commit" = "$VERSION_PREFIX$TAGNAME" ] && echo "- Hotfix tag '$VERSION_PREFIX$TAGNAME' has been back-merged into '$DEVELOP_BRANCH'"
[ -n "$release_branch" ] && echo "- Hotfix tag '$VERSION_PREFIX$TAGNAME' has been back-merged into '$release_branch'"
[ "$commit" = "$VERSION_PREFIX$VERSION" ] && echo "- Hotfix tag '$VERSION_PREFIX$VERSION' has been back-merged into '$DEVELOP_BRANCH'"
[ "$commit" = "$BRANCH" ] && echo "- Hotfix branch '$BRANCH' has been merged into '$DEVELOP_BRANCH'"
fi

if noflag keep; then
if [ $localbranchdeleted -eq $FLAGS_TRUE ]; then
keepmsg="has been locally deleted"
Expand Down
Loading