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

Re: Short form of --force-with-lease

From
Kyle Lippincott <spectral@google.com>
Date
Apr 11, 2024, 20:58 UTC
Message-ID
<CAO_smVhB0QUomdSxGqwvFKrb53NGMZE+y=3zbRnQX+ciLRZyOw@mail.gmail.com>
In-Reply-To
<20240411203225.82557-2-kipras@kipras.org>
On Thu, Apr 11, 2024 at 1:34 PM Kipras Melnikovas <kipras@kipras.org> wrote:
Show 12 quoted lines
>
> > 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'
>
> Correct, and I already have an alias:
> 'pf = push --force-with-lease --force-if-includes'.
>
> However, I see the config option more valuable - it would protect against
> accidental `push -f`, which, out of habit, is very probable to run on accident.
> With the config option, would feel safe and wouldn't need the alias either.

It would normalize the use of `push -f` in people's muscle memory, which would be a potential disaster if someone lost their configuration, but not this muscle memory. It also would break automation/scripts - `git push` is likely used by both humans and automation (custom one-off automation like a personal script, or automation shared by many people) - if they're expecting `git push -f` to do the legacy behavior, then it'll break things if the meaning of `-f` changes. A separate flag (or just using an alias if it's for saving typing) would be safer.

>
> Thanks.
>
>
Previous: Kipras MelnikovasNext: Kipras Melnikovas
Message 5 of 7 in “Short form of --force-with-lease”
  1. Wyatt CarpenterApr 11, 2024
  2. Kipras MelnikovasApr 11, 2024
  3. rsbecker@nexbridge.comApr 11, 2024
  4. Kipras MelnikovasApr 11, 2024
  5. Kyle LippincottApr 11, 2024
  6. Kipras MelnikovasApr 12, 2024
  7. Junio C HamanoApr 11, 2024

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.