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

Re: Race condition in git push --mirror can cause silent ref rewinding

From
Alex Vandiver <alex@chmrr.net>
Date
Jul 2, 2014, 23:10 UTC
Message-ID
<53B49173.4020001@chmrr.net>
In-Reply-To
<xmqqfvijflnr.fsf@gitster.dls.corp.google.com>
On 07/02/2014 06:20 PM, Junio C Hamano wrote:
Show 11 quoted lines
> Alex Vandiver <alex@chmrr.net> writes:
> 
>>     [remote "github"]
>>         url = git@github.com:bestpractical/rt.git
>>         fetch = +refs/*:refs/*
>>         mirror = yes
> 
> "git push github master^:master" must stay a usable way to update
> the published repository to an arbitrary commit, so "if set to
> mirror, do not pretend that a fetch in reverse has happened during
> 'git push'" will not be a solution to this issue.
Hm?  I'm confused, as mirror isn't compatible with refspecs:

$ git push github master^:master error: --mirror can't be combined with refspecs

> Perhaps removing remote.github.fetch would be one sane way forward.
Ahh -- I see.  The repository predates a9f5a355, which split `git remote
add --mirror` into `--mirror=push` and `--mirror=fetch`, because of more
or less this exact problem.  Of course, there is nothing much that can
be done for existing repositories in this situation as it's a legitimate
combination.
 - Alex
Previous: Junio C HamanoNext: Alex Vandiver
Message 3 of 4 in “Race condition in git push --mirror can cause silent ref rewinding”
  1. Alex VandiverJul 2, 2014
  2. Junio C HamanoJul 2, 2014
  3. Alex VandiverJul 2, 2014
  4. Alex VandiverJul 14, 2014

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.