git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: git@vger.kernel.org
Subject: [PATCH] [TOPGIT] make tg remote idempotent
Date: Wed, 25 Feb 2009 21:03:58 +0100	[thread overview]
Message-ID: <1235592240-12616-3-git-send-email-u.kleine-koenig@pengutronix.de> (raw)
In-Reply-To: <1235592240-12616-2-git-send-email-u.kleine-koenig@pengutronix.de>

Before this patch each call to tg remote added three config entries
no matter if they already existed.  After some time my .git/config was
crowded.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 tg-remote.sh |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tg-remote.sh b/tg-remote.sh
index c3e8bd3..3a40081 100644
--- a/tg-remote.sh
+++ b/tg-remote.sh
@@ -27,9 +27,9 @@ git config "remote.$name.url" >/dev/null || die "unknown remote '$name'"
 
 ## Configure the remote
 
-git config --add "remote.$name.fetch" "+refs/top-bases/*:refs/remotes/$name/top-bases/*"
-git config --add "remote.$name.push" "+refs/top-bases/*:refs/top-bases/*"
-git config --add "remote.$name.push" "+refs/heads/*:refs/heads/*"
+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/\\*"
 
 info "Remote $name can now follow TopGit topic branches."
 if [ -z "$populate" ]; then
-- 
1.5.6.5

  reply	other threads:[~2009-02-25 20:05 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-25 19:58 topgit patches Uwe Kleine-König
2009-02-25 20:03 ` [PATCH] [TOPGIT] limit rev-list in branch_contains to a single rev Uwe Kleine-König
2009-02-25 20:03   ` [PATCH] [TOPGIT] allow working with annihilated branches Uwe Kleine-König
2009-02-25 20:03     ` Uwe Kleine-König [this message]
2009-02-25 20:03       ` [PATCH] [TOPGIT] make creating a commit from a topgit branch a function Uwe Kleine-König
2009-02-25 20:04         ` [PATCH] [TOPGIT] implement linearize export method Uwe Kleine-König
2009-02-25 21:23 ` topgit patches Petr Baudis
2009-02-25 23:15   ` Uwe Kleine-König
2009-02-25 23:22     ` Petr Baudis
2009-02-26 13:47       ` Uwe Kleine-König
2009-02-26  6:06     ` martin f krafft
2009-02-26 14:15       ` Uwe Kleine-König
2009-02-27 12:37         ` martin f krafft
2009-02-27 19:42           ` Uwe Kleine-König
2009-03-02 16:26       ` Uwe Kleine-König
2009-03-03  7:54         ` martin f krafft
  -- strict thread matches above, loose matches on Subject: below --
2009-01-14 21:27 [PATCH] [TOPGIT] make tg remote idempotent Uwe Kleine-König
2009-01-21 11:06 ` Uwe Kleine-König
2009-01-21 14:31   ` martin f krafft

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1235592240-12616-3-git-send-email-u.kleine-koenig@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).