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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I think there are two aspects to using "force with lease".

Firstly, you, a person aware of the option, using it. In this case I
think an alias is very fitting, because you get quickly used to just
typing `git pf` or so. Plus, you don't have the disadvantage you
described: if you’re working on a machine without your alias, you’ll
just notice immediately and type the full option.

The other aspect is working in a team. The problem there is, that most
(at least in my surroundings) use plain --force and you have to make
them aware of --force-with-lease. But with an option or an alias, you
depend on them using force with lease instead of plain force, so again I
don't really see the advantage of such an option.

And lastly, a question: say you are using your proposed option and it is
turned on. Now, git refuses to push, you clarify the situation and
actually mean to push --force now. How would you do this? 1) turn off 2)
push 3) turn option on again?

Regards,
Constantin

Quoting Scott Johnson (2018-08-24 18:39:27)
> 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




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux