Permalink
Browse files

Use origin/master instead of master for git qapplied (and company).

  • Loading branch information...
1 parent 9238a88 commit af3f8f65cb006c34cb10745417111a358cbdebdf @jlebar committed May 22, 2012
Showing with 16 additions and 12 deletions.
  1. +6 −5 README.markdown
  2. +1 −1 git-edit-files
  3. +6 −3 git-push-to-hg
  4. +1 −1 git-qapplied
  5. +2 −2 git-qparent
View
@@ -21,8 +21,8 @@ Find the hg commit corresponding to a git commit.
Usage: `git push-to-hg [-t/--tip] PATH_TO_HG_REPO [GIT_REVS]`
Push commits from git to a new qqueue in an hg repository. If GIT\_REVS is
-omitted, push the commits `$(git merge-base HEAD master)..HEAD` (i.e.
-everything in the current branch that's not in master).
+omitted, push the commits `$(git merge-base HEAD origin/master)..HEAD` (i.e.
+everything in the current branch that's not upstream).
If `-t` or `--tip` is specified, update the hg repository to its tip before
pushing. Otherwise, update the hg repository to the revision atop which the
@@ -32,14 +32,15 @@ git commits are based.
Usage: `git push-to-try [-t/--tip] PATH_TO_HG_REPO TRYCHOOSER_PARAMS`
-Push the commits `$(git merge-base HEAD master)..HEAD` (i.e. everything in the
-current branch that's not in master) to try, by way of the given hg repository.
+Push the commits `$(git merge-base HEAD origin/master)..HEAD` (i.e. everything
+in the current branch that's not upstream) to try, by way of the given hg
+repository.
TRYCHOOSER\_PARAMS should be, e.g. `-b do -p all -u all -t none`.
## git-qparent
-Outputs the last common revision of the current branch and master. (This command is a synonym for `git merge-base HEAD master`.)
+Outputs the last common revision of the current branch and master. (This command is a synonym for `git merge-base HEAD origin/master`.)
You might use `git-qparent` when running `git rebase -i`. `git rebase -i master` will move your commits onto the tip of master, whereas `git rebase -i $(git qparent)` will allow you to edit your commits without moving them.
View
@@ -8,7 +8,7 @@ If no revision is given, invoke \$EDITOR on the files modified in the current br
fi
if [[ "$1" == "" ]]; then
- revs="$(git merge-base master HEAD)..HEAD"
+ revs="$(git merge-base origin/master HEAD)..HEAD"
else
if ! echo "$1" | grep -q '\.\.'; then
revs="$1^..$1"
View
@@ -4,7 +4,10 @@ set -e
# Push some commits from git to the git-temp qqueue in a given hg repository.
# Note that this nukes the git-temp qqueue, if it exists.
#
-# If no commit range is specified, we push $(git merge-base master HEAD)..HEAD.
+# If no commit range is specified, we push
+#
+# $(git merge-base origin/master HEAD)..HEAD.
+#
# Otherwise, we push the commit(s) given.
PATH="$(dirname $0):$PATH"
@@ -42,7 +45,7 @@ fi
revs="$2"
if [[ "$revs" == "" ]]; then
- revs="$(git merge-base HEAD master)..HEAD"
+ revs="$(git merge-base HEAD origin/master)..HEAD"
fi
# If revs doesn't contain "..", add "$revs^.." to the beginning.
@@ -69,7 +72,7 @@ function hg_cmd() {
}
first_rev=$(echo "$revs" | sed -e 's/\.\..*//')
-git_parent_rev=$(git merge-base $first_rev master)
+git_parent_rev=$(git merge-base $first_rev origin/master)
# Run git-to-hg-commit, and only run hg pull if it fails.
if [[ "$push_to_tip" == "0" ]]; then
View
@@ -6,4 +6,4 @@
set -e
echo "On branch $(git branch | grep '^\*' | sed 's/^\* //')."
-git log --reverse --date-order --pretty=oneline --abbrev-commit $(git merge-base HEAD master)..HEAD
+git log --reverse --date-order --pretty=oneline --abbrev-commit $(git merge-base HEAD origin/master)..HEAD
View
@@ -1,5 +1,5 @@
#!/bin/bash
-# Like |hg qparent|, gives last common revision between HEAD and master.
+# Like |hg qparent|, gives last common revision between HEAD and upstream.
-git merge-base HEAD master
+git merge-base HEAD origin/master

0 comments on commit af3f8f6

Please sign in to comment.