public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: Max Horn <max@quendi•de>
Cc: git@vger•kernel.org, Felipe Contreras <felipe.contreras@gmail•com>
Subject: Re: What's cooking in git.git (Feb 2014, #06; Wed, 19)
Date: Mon, 24 Feb 2014 08:57:23 -0800	[thread overview]
Message-ID: <xmqqtxbobg98.fsf@gitster.dls.corp.google.com> (raw)
In-Reply-To: <8732A8C8-145E-47F5-BD9A-ECD6E9DE07EF@quendi.de> (Max Horn's message of "Sat, 22 Feb 2014 01:55:55 +0100")

Max Horn <max@quendi•de> writes:

> 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.

  reply	other threads:[~2014-02-24 16:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-19 21:41 What's cooking in git.git (Feb 2014, #06; Wed, 19) Junio C Hamano
2014-02-20 18:39 ` Max Horn
2014-02-20 19:22   ` Junio C Hamano
2014-02-21  9:55     ` Max Horn
2014-02-21 15:46       ` Torsten Bögershausen
2014-02-21 18:04       ` Junio C Hamano
2014-02-22  0:55         ` Max Horn
2014-02-24 16:57           ` Junio C Hamano [this message]
2014-02-24 17:06             ` Junio C Hamano
2014-02-24 17:55               ` Max Horn
2014-02-21 16:18 ` Ramkumar Ramachandra

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=xmqqtxbobg98.fsf@gitster.dls.corp.google.com \
    --to=gitster@pobox$(echo .)com \
    --cc=felipe.contreras@gmail$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=max@quendi$(echo .)de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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