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

Re: [PATCH 2/3] remote: separate the concept of push and fetch mirrors

From
Cchris <jugg@hotmail.com>
Date
Mar 31, 2011, 02:44 UTC
Message-ID
<loom.20110331T040801-714@post.gmane.org>
In-Reply-To
<7v62r0meok.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster <at> pobox.com> writes:
Show 6 quoted lines
> 
> What would we call a person who first asks "I want a push mirror to save
> away my work" and then says "now let's fetch from there", without
> realizing that such a fetch will obliterate his work?  I agree that it
> probably is asking a bit more than "common sense"; it perhaps requires an
> ability to think for 5 minutes what oneself is doing .

If I have to stop and think for 5 minutes before I execute any git command, I think there may be an issue with the tool. :) That said - the above thoughts were never the source of my surprise.

The only surprising aspect of this whole thing was the behavior of branch.autosetupmerge when a 'mirror' remote existed. Essentially the existence of the mirror remote turned all local branches into remote-tracking branches - that is surprising.

I have no issue with --mirror having its current behavior (although the proposed changes certainly are more explicit and therefore clearer), however, I propose that branch.autosetupmerge should ignore remotes with mirror = true.

I'd also propose that when setting up a --mirror, if the repository is not bare, that the fetch refs be set to "refs/*:refs/*" rather than "+refs/*:refs/*".

With those two changes, I get the functionality I want without surprises.

I use the mirror for synchronizing "local" work between my workstations (home/office). So, I use the fact that I can fetch and pull from the mirror.

chris
Previous: Junio C HamanoNext: chris
Message 9 of 13 in “checkout new branch tracks wrong remote (bug?)”
  1. chrisMar 30, 2011
  2. Jeff KingMar 30, 2011
  3. 0/3 better "remote add --mirror" semanticsJeff King, Mar 30, 2011
  4. 1/3 remote: disallow some nonsensical option combinationsJeff King, Mar 30, 2011
  5. 2/3 remote: separate the concept of push and fetch mirrorsJeff King, Mar 30, 2011
  6. Junio C HamanoMar 30, 2011
  7. Jeff KingMar 30, 2011
  8. Junio C HamanoMar 30, 2011
  9. chrisMar 31, 2011
  10. chrisMar 31, 2011
  11. Junio C HamanoMar 31, 2011
  12. chrisMar 31, 2011
  13. 3/3 remote: deprecate --mirrorJeff King, Mar 30, 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.