Skip to content

Commit 9acc278

Browse files
committed
Merge branch 'release/2.2.1'
2 parents 56cd71a + 3366e43 commit 9acc278

File tree

9 files changed

+42
-42
lines changed

9 files changed

+42
-42
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
#### 2.2.1
4+
* fix issue #82 remove color support for cherry-pick hotfix thank you [jrebmann](https://github.com/jrebmann) for reporting this
5+
36
#### 2.2.0
47
* feat(init): add option to sign initial commit (#59)
58
* feat(git-flow): add support for environment credentials (#19)

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ using the complete version number.
7272

7373
## Contributing
7474

75-
If you are resubmiting an open pull request see below. If submiting a new pull request addressing an already open issue with gitflow-avh please link the relevant issue in the description. For any new issues please see below
75+
If submiting a new pull request addressing an already open issue with gitflow-avh please link the relevant issue in the description. For any new issues please see below
7676

7777
### Quick Start for new issues
7878

@@ -85,7 +85,6 @@ If you are resubmiting an open pull request see below. If submiting a new pull r
8585
* When ready to submit a pull request.
8686

8787
### How to submit a pull request
88-
When resubmitting an open pull request from [gitflow-avh](https://github.com/petervanderdoes/gitflow-avh) the base repository will need to be changed from petervanderdoes/gitflow-avh to CJ-Systems/gitflow-cjs.
8988

9089
For any new PRs releated to gitflow-cjs you can use on of the keywords from [Linking a pull request to an issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword) to automatically close the releated issue.
9190

git-flow-hotfix

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -538,34 +538,32 @@ c,cherrypick Cherry Pick to $DEVELOP_BRANCH instead of merge
538538
run_pre_hook "$VERSION_PREFIX$TAGNAME" "$ORIGIN" "$BRANCH"
539539

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

545543
local old_IFS=$IFS # save the field separator
546544
IFS=$'\n' # new field separator, the end of line
547545
for git_line in $(git log --format="%H %s" --reverse $MASTER_BRANCH..$BRANCH | grep -vE "^[a-z0-9]* Merge branch '[^'].*?'$"); do
548546
local commit_hash=$(echo $git_line | cut -d" " -f1)
549547
if [[ $(git log $DEVELOP_BRANCH --grep "$commit_hash" | wc -l) -eq 0 ]]; then
550-
echo "\n${LIGHTGREEN}Cherry picking: $git_line${NOCOLOR}"
548+
echo "\nCherry picking: $git_line${NOCOLOR}"
551549
git_do cherry-pick -x -s $commit_hash
552550
if [[ $? -ne 0 ]]; then
553551
echo "
554552
===============================================================
555553
= Cherry pick has conflicts, steps to continue:
556554
= 1. Fix the conflicts
557-
= 2. Stage the fixed file: '${BLUE}git add <file names>${NOCOLOR}'
558-
= 3. Continue the cherry pick: '${BLUE}git cherry-pick --continue${NOCOLOR}'
555+
= 2. Stage the fixed file: 'git add <file names>'
556+
= 3. Continue the cherry pick: 'git cherry-pick --continue'
559557
= *** If fixing the conflict results in an empty commit,
560-
= you will need to run this command: '${BLUE}git commit --allow-empty${NOCOLOR}'
561-
= 4. Switch back to the hotfix branch: '${BLUE}git checkout $BRANCH${NOCOLOR}'
562-
= 5. Rerun the finish command: '${BLUE}git flow hotfix finish${NOCOLOR}'
563-
= OR run '${BLUE}git cherry-pick --abort${NOCOLOR}' to abort the cherry pick
558+
= you will need to run this command: 'git commit --allow-empty'
559+
= 4. Switch back to the hotfix branch: 'git checkout $BRANCH'
560+
= 5. Rerun the finish command: 'git flow hotfix finish'
561+
= OR run 'git cherry-pick --abort' to abort the cherry pick
564562
===============================================================\n"
565563
die "Cherry pick failed for commit: $commit_hash"
566564
fi
567565
else
568-
echo "\n${LIGHTGREEN}Commit has already been Cherry Picked: $git_line${NOCOLOR}"
566+
echo "\nCommit has already been Cherry Picked: $git_line"
569567
fi
570568
done
571569
IFS=$old_IFS # restore default field separator

git-flow-init

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,6 +429,28 @@ file= use given config file
429429
git_do config $gitflow_config_option gitflow.path.hooks "$hooks_dir"
430430
fi
431431

432+
# Automate pre-commit hook install if it exists on git-flow hooks directory
433+
hooks_dir=$(git config --get gitflow.path.hooks)
434+
hooks_dir=${hooks_dir%%/}
435+
if [ -f "$hooks_dir/pre-commit" ]; then
436+
DOT_GIT_DIR=$(git rev-parse --git-dir)
437+
LOCAL_GIT_HOOKS_DIR="$DOT_GIT_DIR/hooks"
438+
# Check whether there's a previous local pre-commit hook to backup
439+
if [ -f "$LOCAL_GIT_HOOKS_DIR/pre-commit" ]; then
440+
backup="(local hook will be saved)"
441+
fi
442+
default_suggestion="Y"
443+
printf "Install pre-commit hook%s? [$default_suggestion] " " $backup"
444+
if noflag defaults; then
445+
read answer
446+
else
447+
printf "\n"
448+
fi
449+
if [ "${answer:-$default_suggestion}" = "Y" ] || [ "${answer:-$default_suggestion}" = "y" ]; then
450+
ln -s "$hooks_dir/pre-commit" -t "$LOCAL_GIT_HOOKS_DIR" --backup
451+
fi
452+
fi
453+
432454
# TODO: what to do with origin?
433455
}
434456

git-flow-release

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -632,6 +632,12 @@ nodevelopmerge! Don't back-merge develop branch
632632
eval set -- "${FLAGS_ARGV}"
633633

634634
base=${2:-$DEVELOP_BRANCH}
635+
636+
# Fool git flow into thinking we have a create command this allows for consistency with hook naming
637+
# NOTE: this may cause a issue if we ever decide to add an actual create command to git flow
638+
SUBCOMMAND="create"
639+
SUBACTION="start"
640+
635641
# Run filter on the version
636642
VERSION=$(run_filter_hook create-start-version $VERSION)
637643
if [ $? -eq 127 ]; then
@@ -671,13 +677,6 @@ nodevelopmerge! Don't back-merge develop branch
671677
echo "- A new branch '$BRANCH' was created, based on '$base'"
672678
echo "- You are now on branch '$(git_current_branch)'"
673679
echo
674-
echo "Follow-up actions:"
675-
echo "- Bump the version number now!"
676-
echo "- Start committing last-minute fixes in preparing your release"
677-
echo "- When done, run:"
678-
echo
679-
echo " git flow release finish '$VERSION'"
680-
echo
681680
# Run filter on the version
682681
VERSION=$(run_filter_hook create-finish-version $VERSION)
683682
if [ $? -eq 127 ]; then
@@ -731,11 +730,9 @@ nodevelopmerge! Don't back-merge develop branch
731730
fi
732731

733732
if [ "$BASE_BRANCH" = "$DEVELOP_BRANCH" ]; then
734-
SUBCOMMAND="create"
735733
SUBACTION="finish"
736734
_finish_from_develop
737735
else
738-
SUBCOMMAND="create"
739736
SUBACTION="finish"
740737
_finish_base
741738
fi

git-flow-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
#
4040

4141

42-
GITFLOW_VERSION=2.2.0
42+
GITFLOW_VERSION=2.2.1
4343

4444
initialize() {
4545
# A function can not be empty. Comments count as empty.

gitflow-common

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -810,23 +810,4 @@ run_post_hook() {
810810

811811
flags_help() {
812812
eval "$( echo "$OPTIONS_SPEC" | git rev-parse --parseopt -- "-h" || echo exit $? )"
813-
}
814-
815-
#
816-
# Color constants
817-
#
818-
echo_color_support() {
819-
local echo_path=$(which echo)
820-
local echo_out=$($echo_path -e)
821-
if [[ $echo_out == "" ]]; then
822-
alias echo="$echo_path -e "
823-
BLUE="\e[34m"
824-
LIGHTGREEN="\e[92m"
825-
NOCOLOR="\e[0m"
826-
else
827-
BLUE=""
828-
LIGHTGREEN=""
829-
NOCOLOR=""
830-
fi
831-
}
832-
echo_color_support
813+
}
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)