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

Re: [PATCH 2/5] Document details of transport function APIs

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 25, 2009, 18:03 UTC
Message-ID
<7vmyb95vky.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<alpine.LNX.1.00.0903251142470.19665@iabervon.org>
Daniel Barkalow <barkalow@iabervon.org> writes:
Show 19 quoted lines
>> > +	 * If, in the process, the transport determines that the
>> > +	 * remote side actually responded to the push by updating the
>> > +	 * ref to a different value, the transport should modify the
>> > +	 * new_sha1 in the ref. (Note that this is a matter of the
>> > +	 * remote accepting but rewriting the change, not rejecting it
>> > +	 * and reporting that a different update had already taken
>> > +	 * place)
>> > +	 **/
>> 
>> It this even a sane thing to allow?  How would it interact with the
>> "pretend we immediately turned around and fetched them into the remote
>> tracking branches" local updates we usually do?
>
> We already allow a git server to rewrite refs with a hook when it gets 
> them, and we record the pre-rewriting value. This allows the transport to 
> propagate the post-rewriting value back (if it can get it), and we'd 
> update the tracking branches with what the server actually did instead of 
> what we asked it to (i.e., we do what we would do if we really did turn 
> around and fetch them immediately).

But how are you guaranteeing that objects necessary to complete the history the remote end re-written are already available on the local end? Do you have a reverse object transfer phase now in send-pack protocol?

Otherwise I am afraid that you are corrupting the local repository.
Previous: Daniel BarkalowNext: Daniel Barkalow
Message 4 of 5 in “Document details of transport function APIs”
  1. 2/5 Document details of transport function APIsDaniel Barkalow, Mar 25, 2009
  2. Junio C HamanoMar 25, 2009
  3. Daniel BarkalowMar 25, 2009
  4. Junio C HamanoMar 25, 2009
  5. Daniel BarkalowMar 25, 2009

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.