git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jay Soffian <jaysoffian@gmail.com>
To: git <git@vger.kernel.org>
Cc: Junio C Hamano <gitster@pobox.com>
Subject: Re: failed to lock
Date: Thu, 15 Apr 2010 00:00:37 -0400	[thread overview]
Message-ID: <k2x76718491004142100v6e1ece6djc62aa540e51eed5@mail.gmail.com> (raw)
In-Reply-To: <t2i76718491004141402h33bb2044g155ef1715c63904e@mail.gmail.com>

On Wed, Apr 14, 2010 at 5:02 PM, Jay Soffian <jaysoffian@gmail.com> wrote:
> 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.

  reply	other threads:[~2010-04-15  4:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-14 20:49 failed to lock Jay Soffian
2010-04-14 21:02 ` Jay Soffian
2010-04-15  4:00   ` Jay Soffian [this message]
2010-04-15 19:00     ` Junio C Hamano
2010-04-15 19:13       ` Jay Soffian
2010-04-15 22:27         ` Junio C Hamano

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=k2x76718491004142100v6e1ece6djc62aa540e51eed5@mail.gmail.com \
    --to=jaysoffian@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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).