[TopGit PATCH 2/6] tg-remote: use default remote if non is given
- From
Bert Wesarg <bert.wesarg@googlemail.com>
- Date
- Oct 3, 2010, 21:25 UTC
- Message-ID
- <1286141157-30422-2-git-send-email-bert.wesarg@googlemail.com>
- In-Reply-To
- <1286141157-30422-1-git-send-email-bert.wesarg@googlemail.com>
This is usefull if the remote has new topics and you need to populate the local top-bases.
Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
--- README | 2 +- tg-remote.sh | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/README b/README index c418ff4..5a54468 100644 README --- a/README +++ b/README @@ -327,7 +327,7 @@ tg remote and 'git push' to operate on them. (Do NOT use 'git push --all' for your pushes - plain 'git push' will do the right thing.) - It takes a mandatory remote name argument, and optional + It takes a optional remote name argument, and optional '--populate' switch - use that for your origin-style remote, it will seed the local topic branch system based on the remote topic branches. '--populate' will also make 'tg remote' diff --git a/tg-remote.sh b/tg-remote.sh index 86dcd9a..61774d7 100644 tg-remote.sh --- a/tg-remote.sh +++ b/tg-remote.sh @@ -15,13 +15,16 @@ while [ -n "$1" ]; do --populate) populate=1;; -*) - echo "Usage: tg [...] remote [--populate] REMOTE" >&2 + echo "Usage: tg [...] remote [--populate] [REMOTE]" >&2 exit 1;; *) name="$arg";; esac done +[ -n "$name" ] || + name="$base_remote" + git config "remote.$name.url" >/dev/null || die "unknown remote '$name'"
-- tg: (29ab4cf..) bw/tg-remote-use-defualt-remote (depends on: master)