chiark / gitweb /
tg -r REMOTE: Support for switching base remote
authorPetr Baudis <pasky@suse.cz>
Tue, 9 Sep 2008 20:02:07 +0000 (22:02 +0200)
committerPetr Baudis <pasky@suse.cz>
Tue, 9 Sep 2008 20:02:07 +0000 (22:02 +0200)
README
tg.sh

diff --git a/README b/README
index 4d96dfb5a52ebfc0cf40264f317ecd57f12865bf..8299027e97ac579823695cdd6e3b67566a8d10f6 100644 (file)
--- a/README
+++ b/README
@@ -460,3 +460,8 @@ carried over to our local base automagically. Then, the base is merged into
 remote branch and the result is merged to local branch - again, to carry over
 remote conflict resolutions. In the future, this order might be adjustable
 per-update in case local changes are diverging more than the remote ones.
 remote branch and the result is merged to local branch - again, to carry over
 remote conflict resolutions. In the future, this order might be adjustable
 per-update in case local changes are diverging more than the remote ones.
+
+All commands by default refer to the remote that 'tg remote --populate'
+was called on the last time ('topgit.remote' configuration variable). You can
+manually run any command with a different base remote by passing '-r REMOTE'
+_before_ the subcommand name.
diff --git a/tg.sh b/tg.sh
index b2b9191c0ae847952be9217fa11d7061fca33f12..2294a99250b220ee5eed62b2465490948fb5ad23 100644 (file)
--- a/tg.sh
+++ b/tg.sh
@@ -223,7 +223,7 @@ do_help()
                done
 
                echo "TopGit v0.2 - A different patch queue manager"
                done
 
                echo "TopGit v0.2 - A different patch queue manager"
-               echo "Usage: tg ($cmds|help) ..."
+               echo "Usage: tg [-r REMOTE] ($cmds|help) ..."
        elif [ -r "@sharedir@/tg-$1.txt" ] ; then
                cat "@sharedir@/tg-$1.txt"
        else
        elif [ -r "@sharedir@/tg-$1.txt" ] ; then
                cat "@sharedir@/tg-$1.txt"
        else
@@ -251,6 +251,10 @@ setup_hook "pre-commit"
 # this is set by hooks.
 [ -z "$tg__include" ] || return 0
 
 # this is set by hooks.
 [ -z "$tg__include" ] || return 0
 
+if [ "$1" = "-r" ]; then
+       shift; base_remote="$1"; shift
+fi
+
 cmd="$1"
 [ -n "$cmd" ] || die "He took a duck in the face at two hundred and fifty knots"
 shift
 cmd="$1"
 [ -n "$cmd" ] || die "He took a duck in the face at two hundred and fifty knots"
 shift