4 # push-pcp -b master -t pcp -r 6bad98e4b0537c2e99b3906ca7a36f4998ea3419..
8 trap "rm -f $tmp.*; exit 0" 0 1 2 3 15
12 echo >&2 "Usage: pcp-push [options]"
15 echo >&2 " -b branch [defaults to master]"
17 echo >&2 " -r range [defaults to \$(cat pushed.sha)..)]"
18 echo >&2 " -t tree [defaults to pcp]"
19 echo >&2 " -s short format, do not include commit messages"
30 range
=$
(cat pushed.sha
)..
34 while getopts "b:nr:st:?" c
59 shift `expr $OPTIND - 1`
61 [ $# -eq 0 ] || _usage
65 echo "Error: no range from pushed.sha, so need -r range"
70 unset GIT_EXTERNAL_DIFF
71 #old# pull=git://git.pcp.io/$tree.git
72 #old# push="ssh://git.pcp.io/oss/git/$tree.git $branch"
73 pull
=`git config remote.$tree.url`
74 push
=`echo "$pull" | sed -e 's/^git:/ssh:/' -e "s;/git.pcp.io/;/git.pcp.io/oss/git/;"`
76 echo "Changes committed to $pull $branch" >/tmp
/msg
78 git shortlog
--no-merges --numbered $range >$tmp.tmp
81 cat $tmp.tmp
>>/tmp
/msg
83 echo "Nothing to push ... bye."
87 git log
--no-merges -p $range | diffstat
-p1 >>/tmp
/msg
93 echo "Details ..." >>/tmp
/msg
95 git log
--no-merges $range >>/tmp
/msg
98 xclip
-sel clip
< /tmp
/msg
100 echo "(all of this for email is in /tmp/msg)"
104 echo -n "Push to $push? [y|n|q] (or ctrl+C to abort) "
118 echo "Quitting ... pushed.sha not updated"
121 echo "Answer the question, bozo!"
126 $GIT push
--tags $push
132 echo -n "Push to github mirror? [y|n|q] (or ctrl+C to abort) "
146 echo "Quitting ... pushed.sha not updated"
149 echo "Answer the question, bozo!"
153 push
="ssh://git@github.com/performancecopilot/pcp.git"
154 $GIT push
--mirror $push
157 # remember last commit that was pushed ...
159 sha
=`git log | sed -e 's/commit //' -e 1q`
162 echo "+ echo $sha >pushed.sha"
164 echo "$sha" >pushed.sha
168 echo "To send commit mail ..."
169 echo '$ sendcommitmail'