git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bryan Turner <bturner@atlassian.com>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: Git Users <git@vger.kernel.org>
Subject: Re: http-protocol question
Date: Tue, 2 Dec 2014 15:29:43 +1100	[thread overview]
Message-ID: <CAGyf7-GpPiMCj8=ewjVGv5Hkip__ysR_gs20rG4dTvDbEdd2RQ@mail.gmail.com> (raw)
In-Reply-To: <CAGyf7-GZbRBN4O_yNgrmJCya=6f8XQ4O8m7WBa1k8Ve196ajYQ@mail.gmail.com>

On Tue, Dec 2, 2014 at 3:28 PM, Bryan Turner <bturner@atlassian.com> wrote:
> On Tue, Dec 2, 2014 at 2:34 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:
>> Hi Bryan,
>>
>> Bryan Turner wrote:
>>
>>> Is there actually logic somewhere in Git that does that "MAY walk
>>> backwards" step?
>>
>> Yes.  See upload-pack.c::check_non_tip and
>> http://thread.gmane.org/gmane.comp.version-control.git/178814.
>
> Jonathan,
>
> Thanks for the reply! I realize now I didn't really cite the part of
> that documentation that I'm most interested in, which is: "through
> history _or through the reflog_". It's the reflog bit I'm looking for.
> Sorry for not being more clear. check_non_tip appears to look at
> ancestry, walking back up (or down, depending on your view) the DAG to
> see if the requested SHA-1 is reachable from a current ref, so it
> looks like that's covering the "through history" part of that blurb.
>
> The reason I ask is that there is a race condition that exists where
> the ref advertisement lists refs/heads/foo at abc1234, and then foo is
> deleted before the actual upload-pack request comes in. In that
> situation, walking backwards through _history_ will only allow the
> upload-pack to complete unless the deleted ref was merged into another

s/unless/if, sorry. "In that situation, walking backwards through
history will only allow the upload-pack to complete if the deleted ref
was merged into another ref."

> ref prior to being deleted (if I understand the code correctly). It
> seems like looking at the reflogs, and seeing that refs/heads/foo did
> in fact exist and did in fact refer to abc1234, is the only approach
> that could allow the upload-pack to complete. The documentation hints
> that such a thing is possible, but I don't see any code in Git that
> seems to do that.
>
> Does that make more sense? Does that functionality exist and I've just
> overlooked it?
>
> Thanks again,
> Bryan Turner
>
>>
>> Hope that helps,
>> Jonathan

  reply	other threads:[~2014-12-02  4:29 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-02  2:17 http-protocol question Bryan Turner
2014-12-02  3:34 ` Jonathan Nieder
2014-12-02  4:28   ` Bryan Turner
2014-12-02  4:29     ` Bryan Turner [this message]
2014-12-02  4:45     ` Jonathan Nieder
2014-12-02  5:04       ` Bryan Turner
2014-12-02  5:17         ` Jonathan Nieder
2014-12-02  5:30           ` Duy Nguyen
2014-12-02  5:37           ` Duy Nguyen
2014-12-02  5:33         ` Jeff King
2014-12-02  5:47           ` Bryan Turner
2014-12-02  5:52             ` Jeff King
2014-12-02 17:45           ` Junio C Hamano
2014-12-02 19:50             ` Jeff King

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='CAGyf7-GpPiMCj8=ewjVGv5Hkip__ysR_gs20rG4dTvDbEdd2RQ@mail.gmail.com' \
    --to=bturner@atlassian.com \
    --cc=git@vger.kernel.org \
    --cc=jrnieder@gmail.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).