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

Re: What's cooking in git.git (Feb 2014, #06; Wed, 19)

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 24, 2014, 16:57 UTC
Message-ID
<xmqqtxbobg98.fsf@gitster.dls.corp.google.com>
In-Reply-To
<8732A8C8-145E-47F5-BD9A-ECD6E9DE07EF@quendi.de>
Max Horn <max@quendi.de> writes:
Show 15 quoted lines
> On 21.02.2014, at 19:04, Junio C Hamano <gitster@pobox.com> wrote:
>
>>  Isn't it possible for some helpers to _do_ want to
>> tell us that it did not have to force after all by _not_ saying
>> "forced update" and overwrite ->forced_update with zero?
>
> Yes to the first part, no to the last bit: Yes, a transport helper
> can (and frequently does) tell us that no force happened -- by not
> saying "forced update".
> ...
>>  How do we tell helpers that do want to do so apart from other
>> helpers that say "forced update" only when they noticed they are
>> indeed forcing?
>
> I am not completely sure I even understand that bit?
I think I phrased it too imprecisely.

If nobody even knew about the "forced update" before hg helper, then they by definition do not wish to overwrite, of course. But I was worried if we are closing the door for this possible scenario:

 * the calling side sets ref->forced_update to true before invoking
   the helper, knowing that this update is not fast-forward; and
 * the helper does a "magic" (after all, we are talking with an
   external mechanism, which may be a different SCM like darcs) to
   rebase our change on top of the history that the other side
   already have, and makes it a fast-forward, non-forced push.

Such a helper would want a way to say "You may have thought that this does not fast-forward, but the push result ended up to be a fast-forward update", and if we wanted to support that, one thing we may need to allow it to do is to reset ref->forced_update to zero.

But I think I was worried too much into the future---I agree that the code can stay as you proposed until such a remote-helper needs more support, because "overwrite with zero" is necessary but is probably not sufficient---it also may need to be able to tell us what the final resulting commit of the push is, for example.

Previous: Max HornNext: Junio C Hamano
Message 8 of 11 in “What's cooking in git.git (Feb 2014, #06; Wed, 19)”
  1. Junio C HamanoFeb 19, 2014
  2. Max HornFeb 20, 2014
  3. Junio C HamanoFeb 20, 2014
  4. Max HornFeb 21, 2014
  5. Torsten BögershausenFeb 21, 2014
  6. Junio C HamanoFeb 21, 2014
  7. Max HornFeb 22, 2014
  8. Junio C HamanoFeb 24, 2014
  9. Junio C HamanoFeb 24, 2014
  10. Max HornFeb 24, 2014
  11. Ramkumar RamachandraFeb 21, 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.