aboutsummaryrefslogtreecommitdiffstats
path: root/git-request-get
diff options
context:
space:
mode:
Diffstat (limited to 'git-request-get')
-rwxr-xr-xgit-request-get14
1 files changed, 6 insertions, 8 deletions
diff --git a/git-request-get b/git-request-get
index 2ba5ec4..c85b681 100755
--- a/git-request-get
+++ b/git-request-get
@@ -14,8 +14,6 @@ s/[[:space:]]\+//
s/\(=[[:digit:]]\{2\}\)\+$//
/^\(http\|git\)/p
}')"
-# mapfile -t -c 1 -C 'cb() { [[ "$2" =~ (git|http|ssh):// ]] && printf "%s\n" "$2"; }; cb' URLS <<<"$STR"
-# echo "$URLS[@]"
# 2. Check it is in our remotes
mapfile REMOTES < <(git remote -v|awk '{print $1,$2;}')
@@ -27,15 +25,15 @@ for rem in "${REMOTES[@]}" ; do
fi
done
-# 4. Create new branch
-BEG="$(echo "$STR" | awk '/^The following changes since commit / { print $NF }' | sed -e 's/[=:]*$//')"
+# 3. Find the tip of the offered branch
END="$(echo "$STR" | awk '/^for you to fetch changes up to / { print $NF }' | sed -e 's/[=:]*$//')"
-# 5. Fetch the remote
+# 4. Fetch the remote
if [[ -n "$REMOTE" ]] ; then
- git fetch $REMOTE $END
+ git fetch "$REMOTE" "$END"
else
- git fetch $URL $END
+ git fetch "$URL" "$END"
fi
-git checkout -b _4review FETCH_HEAD
+# 5. open new branch
+git checkout -B _4review FETCH_HEAD