X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?p=topgit.git;a=blobdiff_plain;f=tg-remote.sh;h=86dcd9a6ca213bfdc57f5122a557b959c8d2cd00;hp=3a40081b6b32435837c3b597ee4593f38e79de08;hb=82f304a9d9a72111fde3127b15537f67df1d6612;hpb=f263e802af8c5e4b375fa32bb7cee39c7df20d82 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