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

Would a config var for --force-with-lease be useful?

From
Scott Johnson <jaywir3@gmail.com>
Date
Aug 24, 2018, 16:39 UTC
Message-ID
<CAEFop40OJ5MRwM8zxE44yB0f2Fxw9YsUdM1e-H=Nn9e=sAGJ=w@mail.gmail.com>
Hello Everyone:

I'm considering writing a patch that adds a configuration variable that will allow the user to default the command:

git push --force
to:
git push --force-with-lease
As discussed here:
https://stackoverflow.com/questions/30542491/push-force-with-lease-by-default

Now, I understand that there are downsides to having this enabled, namely that a user who has this enabled might forget that they have it enabled, and, as such, on a machine that _doesn't_ have it enabled (of which they are unfamiliar) might then run the more consequential command "git push --force", but my thinking is that adding this as a feature to the git codebase as an _optional_ (i.e. not enabled by default) configuration variable would then save some of us who use a "rebase-then-force-push for pull request" workflow some time and headaches.

Of course, I don't want to submit a patch if this is a feature that isn't likely to be accepted, so I wanted to get some thoughts from the mailing list regarding this idea.

Thank you,
~Scott Johnson
Next: Constantin Weißer
Message 1 of 9 in “Would a config var for --force-with-lease be useful?”
  1. Scott JohnsonAug 24, 2018
  2. Constantin WeißerAug 25, 2018
  3. Johannes SchindelinAug 27, 2018
  4. Phillip WoodAug 28, 2018
  5. Junio C HamanoAug 27, 2018
  6. Ævar Arnfjörð BjarmasonAug 27, 2018
  7. Junio C HamanoAug 27, 2018
  8. Ævar Arnfjörð BjarmasonAug 27, 2018
  9. Junio C HamanoAug 27, 2018

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.