git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: chris <jugg@hotmail.com>
Cc: Jan Hudec <bulb@ucw.cz>, git@vger.kernel.org
Subject: [PATCH 0/3] better "remote add --mirror" semantics
Date: Wed, 30 Mar 2011 15:51:39 -0400	[thread overview]
Message-ID: <20110330195139.GA814@sigill.intra.peff.net> (raw)
In-Reply-To: <20110330145908.GA812@sigill.intra.peff.net>

On Wed, Mar 30, 2011 at 10:59:08AM -0400, Jeff King wrote:

> All of that being said, I'm not sure your config makes sense:
> 
> > [remote "origin"]
> >         fetch = +refs/heads/*:refs/remotes/origin/*
> >         url = ssh://myserver.com/srv/git/myproject.git
> > [remote "mirror"]
> >         url = ssh://chris@myserver.com/srv/git/mirrors/chris/myproject.git
> >         fetch = +refs/*:refs/*
> >         mirror = true
> 
> Your mirror is configured to overwrite everything in refs/ if you fetch
> from it. Meaning it will throw away anything you fetched from "origin",
> as well as any local work. So this config is probably not what you want.
> 
> I'm guessing what you really wanted is a remote only for pushing to, and
> created it with:
> 
>   git remote add --mirror mirror ssh://...
> 
> The --mirror option has problems with that case. See this thread:
> 
>   http://article.gmane.org/gmane.comp.version-control.git/161653

Here is a patch series which I think improves the situation. +cc Jan
Hudec from the mentioned thread.

  [1/3]: remote: disallow some nonsensical option combinations
  [2/3]: remote: separate the concept of push and fetch mirrors
  [3/3]: remote: deprecate --mirror

-Peff

  reply	other threads:[~2011-03-30 19:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-30  2:27 checkout new branch tracks wrong remote (bug?) chris
2011-03-30 14:59 ` Jeff King
2011-03-30 19:51   ` Jeff King [this message]
2011-03-30 19:52     ` [PATCH 1/3] remote: disallow some nonsensical option combinations Jeff King
2011-03-30 19:53     ` [PATCH 2/3] remote: separate the concept of push and fetch mirrors Jeff King
2011-03-30 20:45       ` Junio C Hamano
2011-03-30 20:57         ` Jeff King
2011-03-30 22:22           ` Junio C Hamano
2011-03-31  2:44             ` chris
2011-03-31  2:50               ` chris
2011-03-31  4:03                 ` Junio C Hamano
2011-03-31 12:59                   ` chris
2011-03-30 19:53     ` [PATCH 3/3] remote: deprecate --mirror Jeff King

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=20110330195139.GA814@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=bulb@ucw.cz \
    --cc=git@vger.kernel.org \
    --cc=jugg@hotmail.com \
    /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).