Skip to content

Commit

Permalink
(CSC---fixing-push-set-upstream) fixed push.sh to have remotes work a…
Browse files Browse the repository at this point in the history
…nd set-upstream work
  • Loading branch information
Chris Corwin committed May 7, 2013
1 parent b77b139 commit f9417bf
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,13 @@
#
# @options
# -q, --quiet Suppress the "Pushing not allowed" warning message and silently exit.
# --tags ALSO pushes tags to remote
# options@
#
# @examples
# 1) push
# # pushes current branch
# 2) push some-other-branch
# # pushes some-other-branch...
# 3) push --tags
# # pushes current branch -AND- pushes any tags
# examples@
#
# @dependencies
Expand All @@ -42,7 +39,6 @@ if (( numArgs > 0 && numArgs < 3 )); then
until [ -z "$1" ]; do
[ "$1" = "--admin" ] && [ "$ADMIN" = "true" ] && isAdmin=true
{ [ "$1" = "-q" ] || [ "$1" = "--quiet" ]; } && isQuiet=true
[ "$1" = "--tags" ] && pushTags=true
! echo "$1" | egrep -q "^-" && branch="$1"
shift
done
Expand Down Expand Up @@ -112,21 +108,13 @@ if [ "$yn" == "y" ] || [ "$yn" == "Y" ]; then
fi
fi

if [ $pushTags ]; then
echo
echo "Now ${A}pushing${X} tags to: ${COL_GREEN} ${_remote} ${X}"
echo "$ git push --tags ${_remote}"
git push --tags ${_remote}
echo ${O}${H2HL}${X}
fi

hasRemote=$(git config branch.$branch.remote 2> /dev/null)
if [ -z "$hasRemote" ]; then
echo
echo ${Q}"Setup remote tracking of ${COL_GREEN}${_remote}${Q} for ${B}\`${branch}\`${Q}? (y) n"
read yn
if [ -z "$yn" ] || [ "$yn" = "y" ]; then
git branch --set-upstream-to=$_remote/$branch $branch
git branch --set-upstream $_remote/$branch $branch
fi
fi

Expand Down

5 comments on commit f9417bf

@cmcculloh
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, did you not like the push tags thing, or where you just trying to switch back from --set-upstream-to to --set-upstream?

(the reason I made it --set-upstream-to was because when I updated git it kept throwing warnings about --set-upstream being deprecated)

@chriscorwin
Copy link
Collaborator

@chriscorwin chriscorwin commented on f9417bf May 10, 2013 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cmcculloh
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fair enough. I'm betting you're on an old version of Git. Rather than try and get everyone to upgrade their Git version, I'll just (eventually) re-apply the other changes that got wiped, but, leave --set-upstream in place.

@Smolations
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that we should NOT be adding any new features to GitScripts2 if a GitScripts3 is in the works. As you stated McCulloh, some of the changes we may want to make could have dependencies on newer versions of Git. I am also not confident how well-tested any of the new features are.

Instead, we should only focus on bug fixes with GS2. Agree/Disagree?

@cmcculloh
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine with me.

Please sign in to comment.