Skip to content

Commit

Permalink
Change the default behaviour of all scripts to NOT fetch.
Browse files Browse the repository at this point in the history
This already was the default behaviour of git-flow-feature, but now it
is the default for the other scripts, too.

RATIONALE: Due to limitations on some platforms (and some
implementations of getopt), it's impossible to turn off the -f (fetch)
option.  Therefore, it must now be set explicitly.

Also, this makes git-flow work in stand-alone repositories (i.e. repos
that do not have an origin remote at all).
  • Loading branch information
nvie committed Jul 22, 2010
1 parent ec0b854 commit de95e00
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 11 deletions.
16 changes: 11 additions & 5 deletions git-flow-hotfix
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ require_no_existing_hotfix_branches() {
}

cmd_start() {
DEFINE_boolean fetch true "fetch from $ORIGIN before performing finish" F
DEFINE_boolean fetch false "fetch from $ORIGIN before performing finish" F
parse_args "$@"
BASE=${2:-$MASTER_BRANCH}
require_version_arg
Expand All @@ -167,7 +167,9 @@ cmd_start() {
if flag fetch; then
git fetch -q "$ORIGIN" "$MASTER_BRANCH"
fi
require_branches_equal "$MASTER_BRANCH" "$ORIGIN/$MASTER_BRANCH"
if has "$ORIGIN/$MASTER_BRANCH" "$(git_remote_branches)"; then
require_branches_equal "$MASTER_BRANCH" "$ORIGIN/$MASTER_BRANCH"
fi

# create branch
git checkout -b "$BRANCH" "$BASE"
Expand All @@ -187,7 +189,7 @@ cmd_start() {
}

cmd_finish() {
DEFINE_boolean fetch true "fetch from $ORIGIN before performing finish" F
DEFINE_boolean fetch false "fetch from $ORIGIN before performing finish" F
DEFINE_boolean sign false "sign the release tag cryptographically" s
DEFINE_string signingkey "" "use the given GPG-key for the digital signature (implies -s)" u
DEFINE_string message "" "use the given tag message" m
Expand All @@ -209,8 +211,12 @@ cmd_finish() {
git fetch -q "$ORIGIN" "$DEVELOP_BRANCH" || \
die "Could not fetch $DEVELOP_BRANCH from $ORIGIN."
fi
require_branches_equal "$MASTER_BRANCH" "$ORIGIN/$MASTER_BRANCH"
require_branches_equal "$DEVELOP_BRANCH" "$ORIGIN/$DEVELOP_BRANCH"
if has "$ORIGIN/$MASTER_BRANCH" "$(git_remote_branches)"; then
require_branches_equal "$MASTER_BRANCH" "$ORIGIN/$MASTER_BRANCH"
fi
if has "$ORIGIN/$DEVELOP_BRANCH" "$(git_remote_branches)"; then
require_branches_equal "$DEVELOP_BRANCH" "$ORIGIN/$DEVELOP_BRANCH"
fi

# try to merge into master
# in case a previous attempt to finish this release branch has failed,
Expand Down
16 changes: 11 additions & 5 deletions git-flow-release
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ require_no_existing_release_branches() {
}

cmd_start() {
DEFINE_boolean fetch true "fetch from $ORIGIN before performing finish" F
DEFINE_boolean fetch false "fetch from $ORIGIN before performing finish" F
parse_args "$@"
BASE=${2:-$DEVELOP_BRANCH}
require_version_arg
Expand All @@ -162,7 +162,9 @@ cmd_start() {
if flag fetch; then
git fetch -q "$ORIGIN" "$DEVELOP_BRANCH"
fi
require_branches_equal "$DEVELOP_BRANCH" "$ORIGIN/$DEVELOP_BRANCH"
if has "$ORIGIN/$DEVELOP_BRANCH" "$(git_remote_branches)"; then
require_branches_equal "$DEVELOP_BRANCH" "$ORIGIN/$DEVELOP_BRANCH"
fi

# create branch
git checkout -b "$BRANCH" "$BASE"
Expand All @@ -182,7 +184,7 @@ cmd_start() {
}

cmd_finish() {
DEFINE_boolean fetch true "fetch from $ORIGIN before performing finish" F
DEFINE_boolean fetch false "fetch from $ORIGIN before performing finish" F
DEFINE_boolean sign false "sign the release tag cryptographically" s
DEFINE_string signingkey "" "use the given GPG-key for the digital signature (implies -s)" u
DEFINE_string message "" "use the given tag message" m
Expand All @@ -205,8 +207,12 @@ cmd_finish() {
git fetch -q "$ORIGIN" "$DEVELOP_BRANCH" || \
die "Could not fetch $DEVELOP_BRANCH from $ORIGIN."
fi
require_branches_equal "$MASTER_BRANCH" "$ORIGIN/$MASTER_BRANCH"
require_branches_equal "$DEVELOP_BRANCH" "$ORIGIN/$DEVELOP_BRANCH"
if has "$ORIGIN/$MASTER_BRANCH" "$(git_remote_branches)"; then
require_branches_equal "$MASTER_BRANCH" "$ORIGIN/$MASTER_BRANCH"
fi
if has "$ORIGIN/$DEVELOP_BRANCH" "$(git_remote_branches)"; then
require_branches_equal "$DEVELOP_BRANCH" "$ORIGIN/$DEVELOP_BRANCH"
fi

# try to merge into master
# in case a previous attempt to finish this release branch has failed,
Expand Down
2 changes: 1 addition & 1 deletion git-flow-support
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ require_base_is_on_master() {
}

cmd_start() {
DEFINE_boolean fetch true "fetch from $ORIGIN before performing finish" F
DEFINE_boolean fetch false "fetch from $ORIGIN before performing finish" F
parse_args "$@"
require_version_arg
require_base_arg
Expand Down

0 comments on commit de95e00

Please sign in to comment.