Git Mailing List Archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: <rsbecker@nexbridge.com>
Cc: "'Kipras Melnikovas'" <kipras@kipras.org>,
	 <wyattscarpenter@gmail.com>, <git@vger.kernel.org>
Subject: Re: Short form of --force-with-lease
Date: Thu, 11 Apr 2024 14:30:44 -0700	[thread overview]
Message-ID: <xmqq7ch3r3i3.fsf@gitster.g> (raw)
In-Reply-To: <01e101da8c45$66d33240$347996c0$@nexbridge.com> (rsbecker@nexbridge.com's message of "Thu, 11 Apr 2024 15:21:00 -0400")

<rsbecker@nexbridge.com> writes:

> If this is mostly about saving typing, you could get a similar effect adding
> an alias. Something like
>
> git config --global alias.pushfl 'push --force-with-lease'

The use of --force-with-lease without specifying which commit you
took lease on is not all that safe [*], so I am not sure how useful
such an alias will be.

Configuring how "--force" behaves and changing it to an unadorned
"--force-with-lease" is to promote a not-so-safe feature as if it is
safe with false sense of safety, which is not something we would
want to do.


[Footnote]

 * This of course highly depends on your workflow and third-party
   companion tools.  If you (or your IDE in the background) fetch
   from the remote after you started working on the commit to be
   force-pushed, it would update the tip of the remote-tracking
   branch, making --force-with-lease base its decision on a wrong
   commit that your work is not based on.

      parent reply	other threads:[~2024-04-11 21:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-11 17:16 Short form of --force-with-lease Wyatt Carpenter
2024-04-11 17:36 ` Kipras Melnikovas
2024-04-11 19:21   ` rsbecker
2024-04-11 20:32     ` Kipras Melnikovas
2024-04-11 20:58       ` Kyle Lippincott
2024-04-12  9:00         ` Kipras Melnikovas
2024-04-11 21:30     ` Junio C Hamano [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=xmqq7ch3r3i3.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=kipras@kipras.org \
    --cc=rsbecker@nexbridge.com \
    --cc=wyattscarpenter@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 read-only IMAP folder(s) and NNTP newsgroup(s).