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

Re: failed to lock

From
Jay Soffian <jaysoffian@gmail.com>
Date
Apr 15, 2010, 04:00 UTC
Message-ID
<k2x76718491004142100v6e1ece6djc62aa540e51eed5@mail.gmail.com>
In-Reply-To
<t2i76718491004141402h33bb2044g155ef1715c63904e@mail.gmail.com>
On Wed, Apr 14, 2010 at 5:02 PM, Jay Soffian <jaysoffian@gmail.com> wrote:
Show 14 quoted lines
> Ah, this is the problem:
>
> $ git push mirror
> Total 0 (delta 0), reused 0 (delta 0)
> error: Ref refs/remotes/origin/master is at
> 81358fbe72926d74bdeda85669d655e144572c48 but expected
> 3c0a87afc2e9248890dd6de40b5039bcb48c8516
> remote: error: failed to lock refs/remotes/origin/master
> To ssh://mirror/repo
>   3c0a87a..81358fb  origin/HEAD -> origin/HEAD
>  ! [remote rejected] origin/master -> origin/master (failed to lock)
> error: failed to push some refs to 'ssh://mirror/repo'
>
> The origin/HEAD symref and --mirror do not get along together. Hmm.
Proposal: receive-pack should look through the list of heads it has
received and check whether each is locally a symref. If so, and if the
destination of the symref is also among the list of heads, it should
ignore the symref update.

In the example above, receive-pack would determine that refs/remotes/origin/HEAD locally is a symref to refs/remotes/origin/master. Since refs/remotes/origin/master is in the list of heads, it would ignore the update for refs/remotes/origin/HEAD.

If that sounds reasonable, I can work on a patch.
In case you're wondering how I got into this situation:

server$ git clone --bare /shared/project.git ~/backup/project.git client$ git clone server:/shared/project.git client$ cd project client$ git remote add --mirror backup server:~/backup/project.git client$ work, commit, work, commit client$ git push backup

j.
Previous: Jay SoffianNext: Junio C Hamano
Message 3 of 6 in “failed to lock”
  1. Jay SoffianApr 14, 2010
  2. Jay SoffianApr 14, 2010
  3. Jay SoffianApr 15, 2010
  4. Junio C HamanoApr 15, 2010
  5. Jay SoffianApr 15, 2010
  6. Junio C HamanoApr 15, 2010

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.