[PATCH] tg-remote: don't add push specs but warn about existing ones.

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

 



topgit used to add some push specs to assert that topbases are pushed,
too.  This should now be handled by tg-push.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@xxxxxxxxxxxxxx>
Cc: Marc Weber <marco-oweber@xxxxxx>
Cc: martin f. krafft <madduck@xxxxxxxxxx>
Cc: 528442@xxxxxxxxxxxxxxx
---
 tg-remote.sh |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/tg-remote.sh b/tg-remote.sh
index 3a40081..86dcd9a 100644
--- a/tg-remote.sh
+++ b/tg-remote.sh
@@ -28,8 +28,13 @@ git config "remote.$name.url" >/dev/null || die "unknown remote '$name'"
 ## Configure the remote
 
 git config --replace-all "remote.$name.fetch" "+refs/top-bases/*:refs/remotes/$name/top-bases/*" "\\+refs/top-bases/\\*:refs/remotes/$name/top-bases/\\*"
-git config --replace-all "remote.$name.push" "+refs/top-bases/*:refs/top-bases/*" "\\+refs/top-bases/\\*:refs/top-bases/\\*"
-git config --replace-all "remote.$name.push" "+refs/heads/*:refs/heads/*" "\\+refs/heads/\\*:refs/heads/\\*"
+
+if git config --get-all "remote.$name.push" "\\+refs/top-bases/\\*:refs/top-bases/\\*" >/dev/null && test "xtrue" != "x$(git config --bool --get topgit.dontwarnonoldpushspecs)"; then
+	info "Probably you want to remove the push specs introduced by an old version of topgit:"
+	info '       git config --unset-all "remote.'$name'.push" "\\+refs/top-bases/\\*:refs/top-bases/\\*"'
+	info '       git config --unset-all "remote.'$name'.push" "\\+refs/heads/\\*:refs/heads/\\*"'
+	info '(or use git config --bool --add topgit.dontwarnonoldpushspecs true to get rid of this warning)'
+fi
 
 info "Remote $name can now follow TopGit topic branches."
 if [ -z "$populate" ]; then
-- 
1.6.2.4

--
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]