Naming the --forec option [[Re: PATCH: improve git switch documentation]]

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

 



On 10/07/2021 22:49, Felipe Contreras wrote:
Martin wrote:
For each force-needing action, you should have to specify it's own force flag. >
> OK, but I don't see the concrete proposal. What would be the
> flag that
> makes -c "forceful"?
>

Well that starts yet another topic.

At the moment, it is
   --force-create which is absorbing the flag into the option.

And by (apparent) convention it also is the uppercasing of the option
   -C
same as the uppercasing of the -B in checkout.

I am not really sure if the uppercasing is the best idea.
If your suggestion "core.advanced " were to come, I would vote that uppercase single letter force options should be restricted to advanced.


If -n is introduced, we can think about what to do about -N.
Should the  --force-*  style be kept?
   --force-new
   -N

Or the (unfortunate? / see below ) "--discard-changes" style:
   --discard-existing-branch -n <branchname>

I am against using --reset instead of --force-new.
At least I can say, if I use "-N", I want a *new* branch. I don't care about any old branch under that name.

Also "--reset" does not have the same alerting properties to me, as "force" or "discard" have. This may be my English, but to me "reset" does not have the same alerting property.




The general problem is, if there is more than one force-needing action, then which one does -f act on?

Any force-needing action, that only applies with another option (such as -N) can have a --force-*. So the plain -f is not used for it.

But, what if more than one force-needing event can happen (not just switch, but any command), even without any extra options? (May not yet be the case / not checked).

git switch has attempted to solve that.
The result IMHO is a disaster.
"-f" / "--force" is made an alias in favour for
   --discard-changes
What changes?






[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