Lines Matching +full:user +full:- +full:config
4 # Creates a PR-### branch, pulls the commits, opens up an interactive rebase to
24 local user=$(curl -s $api | json user.login)
26 local curhead="$(git show --no-patch --pretty=%H HEAD)"
27 local curbranch="$(git rev-parse --abbrev-ref HEAD)"
29 IFS=$'\n' cleanlines=($(git status -s -uno))
30 if [ ${#cleanlines[@]} -ne 0 ]; then
37 branch=PR-$num
43 me=$(git config github.user || git config user.name)
45 echo "run 'git config --add github.user <username>'" >&2
49 exists=$(git show --no-patch --pretty=%H $branch 2>/dev/null)
55 git pull --rebase origin pull/$num/head
58 git rebase -i $curbranch # squash and test
60 if [ $? -eq 0 ]; then
67 # add the PR-URL to the last commit, after squashing
69 if [ $# -eq 0 ]; then
70 echo "Usage: $0 finish <branch> (while on a PR-### branch)" >&2
78 "ref: refs/heads/PR-"*)
79 prnum=${ref#ref: refs/heads/PR-}
82 echo "not on the PR-## branch any more!" >&2
87 local me=$(git config github.user || git config user.name)
89 echo "run 'git config --add github.user <username>'" >&2
93 set -x
103 local user=$(curl -s $api | json user.login)
105 local lastmsg="$(git log -1 --pretty=%B)"
108 PR-URL: ${prweb}
109 Credit: @${user}
111 Reviewed-by: @${me}
113 git commit --amend -m "$newmsg"
115 git merge PR-${prnum} --ff-only
125 if [[ "$url" =~ ^[0-9]+$ ]]; then
131 local o="$(git config --get remote.${us}.url)"
141 url="$(echo $url | perl -p -e 's/#issuecomment-[0-9]+$//g')"
143 local p='^https:\/\/github.com\/[^\/]+\/[^\/]+\/pull\/[0-9]+$'
158 echo "${url/\/pull\/+([0-9])/}"