Git development
 help / color / mirror / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Jeff King <peff@peff.net>
Cc: Mike Galbraith <efault@gmx.de>,
	Junio C Hamano <gitster@pobox.com>, git <git@vger.kernel.org>
Subject: [PATCH] builtin-remote: resurrect forced updates to tracked branches
Date: Tue, 22 Apr 2008 14:26:46 +0100 (BST)	[thread overview]
Message-ID: <alpine.DEB.1.00.0804221425310.4460@eeepc-johanness> (raw)
In-Reply-To: <20080422130918.GB27878@sigill.intra.peff.net>


During the rewrite of git-remote as a builtin, the ability to force
updating the tracked branches (i.e. forcing non-fast-forwards) was
lost.

This patch fixes that.

Noticed by Mike Galbraith, analyzed by Jeff King.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>

---

	On Tue, 22 Apr 2008, Jeff King wrote:

	> On Tue, Apr 22, 2008 at 02:03:43PM +0100, Johannes Schindelin wrote:
	> 
	> > Oh, that's right: only "git remote prune" will delete stale refs only.
	> > 
	> > But my other point about possibly interfering with local 
	> > branches still holds true.
	> 
	> In that case, I think that the '+' should come only without 
	> --mirror, and my complaint is then that "--mirror" is a horrible name 
	> for that option. Though when I saw it, I really expected it to do 
	> something about the _push_ line, since that is the only other place we 
	> have a --mirror option. It would make sense to me for it to set up 
	> remote.$x.mirror (which is newly added in next). But then, git-remote 
	> doesn't seem to be geared towards pushing at all.

	I still think that the --mirror option has merit, but I missed 
	that your patch did fix the behviour _without_ --mirror.

	This is my attempt.

 builtin-remote.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/builtin-remote.c b/builtin-remote.c
index d4f2132..117ff60 100644
--- a/builtin-remote.c
+++ b/builtin-remote.c
@@ -114,7 +114,7 @@ static int add(int argc, const char **argv)
 			strbuf_addf(&buf2, "refs/%s:refs/%s",
 					item->path, item->path);
 		else
-			strbuf_addf(&buf2, "refs/heads/%s:refs/remotes/%s/%s",
+			strbuf_addf(&buf2, "+refs/heads/%s:refs/remotes/%s/%s",
 					item->path, name, item->path);
 		if (git_config_set_multivar(buf.buf, buf2.buf, "^$", 0))
 			return 1;

  reply	other threads:[~2008-04-22 13:27 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-22  9:48 git remote update -> rejected Mike Galbraith
2008-04-22 10:34 ` Jeff King
2008-04-22 10:55   ` Mike Galbraith
2008-04-22 11:11     ` Jeff King
2008-04-22 11:58       ` Johannes Schindelin
2008-04-22 12:56         ` Jeff King
2008-04-22 13:03           ` Johannes Schindelin
2008-04-22 13:09             ` Jeff King
2008-04-22 13:26               ` Johannes Schindelin [this message]
2008-04-22 17:00         ` Junio C Hamano
2008-04-22 12:41       ` Teemu Likonen
2008-04-22 12:56         ` Johannes Schindelin
2008-04-22 13:01           ` Jeff King
2008-04-22 13:05             ` Johannes Schindelin
2008-04-22 13:53               ` Paolo Bonzini
2008-04-22 13:39           ` Teemu Likonen
2008-04-22 13:49             ` Johannes Schindelin
2008-04-22 14:04               ` Teemu Likonen
2008-04-22 14:10                 ` Paolo Bonzini
2008-04-22 15:08                   ` Johannes Schindelin
2008-04-22 15:26                     ` Paolo Bonzini
2008-04-22 16:23                       ` Paolo Bonzini
2008-04-22 16:42                         ` Johannes Schindelin
2008-04-22 16:50           ` Junio C Hamano
2008-04-22 17:23             ` [PATCH] remote add: disallow --master and --mirror with non-bare repositories Johannes Schindelin
2008-04-22 18:45               ` Paolo Bonzini
2008-04-22 18:46               ` [PATCH] remote add: disallow --master and --mirror with non-bare repositories (review) Paolo Bonzini
2008-04-22 22:04                 ` Johannes Schindelin

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=alpine.DEB.1.00.0804221425310.4460@eeepc-johanness \
    --to=johannes.schindelin@gmx.de \
    --cc=efault@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=peff@peff.net \
    /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