git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jakub Narebski <jnareb@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH v3 0/6]
Date: Tue, 23 Jul 2013 11:26:38 -0700	[thread overview]
Message-ID: <7v8v0x874x.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <loom.20130723T113216-324@post.gmane.org> (Jakub Narebski's message of "Tue, 23 Jul 2013 09:33:02 +0000 (UTC)")

Jakub Narebski <jnareb@gmail.com> writes:

> Junio C Hamano <gitster <at> pobox.com> writes:
>
>> 
>> This is mostly unchanged since the previous round, except that
>> 
>>  * The option is spelled "--force-with-lease=<ref>:<expect>".
>>    Nobody liked "cas" as it was too technical, many disliked
>>    "lockref" because "lock" sounded as if push by others were
>>    excluded by it while in fact this is to fail us.
>
> Perhaps "--force-gently" ? :-)

Hmph.  But we usually use "gently" to mean "do not give the end user
an error message--the caller handles the error itself".

While the option lets you break the usual "must fast-forward" rule,
it is more precise in that the remote ref must be pointing at not
just any ancestor of what you are pushing, but has to be at the
exact commit you specify.

E.g. if you have built one commit on top of the shared branch, and
try to push it with "push --cas=pu:HEAD^ HEAD:pu" (because you know
one commit before the tip is where you started from), your push will
be rejected if somebody else did an equivalent of "reset HEAD~3" on
the receiving end (perhaps because the top commits recorded some
material inappropriate for the project).  Your new commit is still a
decendant of that rewound tip, and usual "must fast-forward" rule
would accept the push, but with "push --cas=pu:HEAD^ HEAD:pu", you
will notice that somebody wanted to rewind the tip and pushing your
work that contains these dropped commit contradicts with that wish.

So I dunno.

  reply	other threads:[~2013-07-23 18:26 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-23  6:43 [PATCH v3 0/6] "git push --cas/--lockref" renamed to "--force-with-lease" Junio C Hamano
2013-07-23  6:43 ` [PATCH v3 1/6] cache.h: move remote/connect API out of it Junio C Hamano
2013-07-23  6:43 ` [PATCH v3 2/6] builtin/push.c: use OPT_BOOL, not OPT_BOOLEAN Junio C Hamano
2013-07-23  6:43 ` [PATCH v3 3/6] remote.c: add command line option parser for "--force-with-lease" Junio C Hamano
2013-07-23  6:43 ` [PATCH v3 4/6] push --force-with-lease: implement logic to populate old_sha1_expect[] Junio C Hamano
2013-07-23  6:43 ` [PATCH v3 5/6] push --force-with-lease: tie it all together Junio C Hamano
2013-07-23  6:43 ` [PATCH v3 6/6] t5533: test "push --force-with-lease" Junio C Hamano
2013-07-23  9:33 ` [PATCH v3 0/6] Jakub Narebski
2013-07-23 18:26   ` Junio C Hamano [this message]
2013-07-23 21:26     ` Philip Oakley
2013-07-23 23:18       ` Eric Sunshine
2013-08-01 18:05 ` [PATCH v3 7/6] t5540/5541: smart-http does not support "--force-with-lease" Junio C Hamano
2013-08-02 23:13 ` [PATCH v3 8/6] send-pack: fix parsing of --force-with-lease option Junio C Hamano
2013-08-02 23:14 ` [PATCH v3 9/6] push: teach --force-with-lease to smart-http transport 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=7v8v0x874x.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=jnareb@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).