Thread (32 messages) flat view 32 messages, 3 authors, 2016-06-15

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

From: Uwe Kleine-König <hidden>
Date: 2016-06-15 22:49:41

Hello,

On Sun, Oct 03, 2010 at 11:25:53PM +0200, Bert Wesarg wrote:
quoted hunk ↗ jump to hunk
This is usefull if the remote has new topics and you need to populate the local
top-bases.

Signed-off-by: Bert Wesarg <redacted>

---
 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"
+
Doesn't this need error checking, i.e. what happens if tg remote was
never called before?  Hmm, seems to be a problem that already exists
now?!  Took your patch anyhow.
 git config "remote.$name.url" >/dev/null || die "unknown remote '$name'"
 
 
-- 
tg: (29ab4cf..) bw/tg-remote-use-defualt-remote (depends on: master)
-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help