From: Xavier Morel <xmo@odoo.com>
To: git@vger.kernel.org
Subject: Re: Proposalö git push -F
Date: Tue, 24 Aug 2021 12:23:23 +0200 [thread overview]
Message-ID: <c49da491-f8a3-440f-54e2-295be8dbcfd7@odoo.com> (raw)
In-Reply-To: <xmqqim68lp20.fsf@gitster.c.googlers.com>
> Because the form "--force-with-lease=<this-exact-commit>" is a
> strict improvement over "--force", but the lazy "guess where the
> other end should be" form, i.e. "--force-with-lease" alone, is worse
> than "--force" in that it gives users false sense of security
> without offering the safety the "lease" mechanism gives.
That seems like a case of the perfect being the enemy of the good.
Generaly, "force with lease" is a better behaviour than "force". It will
not catch all usage errors, but it will catch lots: again last week
colleagues had issues which would had been caught by caught by using
"--force-with-lease" instead" of "-f", but of course "-f" is "the
default" in rebase-based workflows, what with being so short and sweet.
I found XonqNopp's proposal as I was planning to post a similar message,
though stricter: I don't think `--force` deserves a short form at all, I
believe `-f` should be progressively migrated over to alias to
`force-with-lease` as it's a significantly better default behaviour, and
the odd *need* for `--force` (of which I can't personnally remember one)
can be typed out in its entirety.
For the vast majority of users, all it will do is catch genuine errors.
For a small minority it will have no effect[0]. And for an infinitesimal
number it will be unhelpful as `--force` without lease or inclusion is
genuinely what they were looking for.
I genuinely do not understand what `force-if-includes` does from reading
the manpage and just learned that it exists from Johannes Schindelin's
message, it might be an even better default behaviour for `-f`.
Either way I think `-f` should not, ultimately, alias to `--force`.
My idea there was to introduce a setting initially defaulting to `false`
and a warning about the migration (triggered on `-f` when that setting
is unset), then a few versions later flip the default to `true`.
[0] and I would expect users of tools which helpfully fetch in the
background to not be using the CLI, and thus not be impacted by this change.
prev parent reply other threads:[~2021-08-24 10:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-02 12:35 Proposalö git push -F XonqNopp
2021-03-03 6:38 ` Junio C Hamano
2021-03-04 10:02 ` Johannes Schindelin
2021-08-24 10:23 ` Xavier Morel [this message]
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=c49da491-f8a3-440f-54e2-295be8dbcfd7@odoo.com \
--to=xmo@odoo.com \
--cc=git@vger.kernel.org \
/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).