git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] remote: allow "-t" with fetch mirrors

From
Junio C Hamano <gitster@pobox.com>
Date
May 26, 2011, 17:08 UTC
Message-ID
<7vk4ddxucf.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20110526151100.GA2881@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 15 quoted lines
> Commit 13fc2c1 (remote: disallow some nonsensical option
> combinations, 2011-03-30) made it impossible to use "remote
> add -t foo --mirror". The argument was that specifying
> specific branches is useless because:
>
>   1. Push mirrors do not want a refspec at all.
>
>   2. The point of fetch mirroring is to use a broad refspec
>      like "refs/*", but using "-t" overrides that.
>
> Point (1) is valid; "-t" with push mirrors is useless. But
> point (2) ignored another side effect of using --mirror: it
> fetches the refs directly into the refs/ namespace as they
> are found upstream, instead of placing them in a
> separate-remote layout.

Hmmm, I still fail to see the point of ignoring "mirror" aspect and constricting that with -t.

> So 13fc2c1 was overly constrictive, and disallowed
> reasonable specific-branch mirroring, like:
>
>   git remote add -t heads/foo -t heads/bar --mirror=fetch

I mildly disagree that it is "reasonable". I would understand if it were something like this:

  git remote add -t heads/foo:heads/foo -t heads/bar:heads/bar

I am not saying selective copying is bad or useless. It would be useful in some situations. I am saying that is not a mirror, and reusing the same --mirror option for a different meaning may introduce confusion.

Previous: Jeff KingNext: Jeff King
Message 4 of 5 in “remote: allow "-t" with fetch mirrors”
  1. remote: allow "-t" with fetch mirrorsJeff King, May 26, 2011
  2. Johannes SixtMay 26, 2011
  3. Jeff KingMay 26, 2011
  4. Junio C HamanoMay 26, 2011
  5. Jeff KingMay 26, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.