[TopGit PATCH 2/6] tg-remote: use default remote if non is given

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>

---
 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)
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]