Re: [PATCH v8 2/2] interpret_trailers: for three options parse add warning

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

 



On Mon, Mar 15, 2021 at 2:07 PM ZheNing Hu via GitGitGadget
<gitgitgadget@xxxxxxxxx> wrote:
>
> From: ZheNing Hu <adlternative@xxxxxxxxx>
>
> When using `interpret-trailers`, if user accidentally fill in the
> wrong option values (e.g. `--if-exists=addd` or `--where=begin` or
> `--if-missing=do-nothing`), git will exit quietly, and the user may
> not even know what happened.
>
> So lets provides warnings when git parsing this three options:
> "unknown value '%s' for key ('where'|'--if-exist'|'--if-missing')".
> This will remind the user :"Oh, it was because of my spelling error."
> (or using a synonym for error).

I am not against this, but I just want to say that when I previously
worked on `interpret-trailers` I think I implemented or suggested such
warnings, but they were rejected.

I think the reason they were rejected was to improve compatibility
with future versions of Git where more options would be implemented.

For example if in a few years someone implements `--where=middle` and
some people use it in a script like this:

git interpret-trailers --where=middle --trailer foo=bar

Then when such a script would be used with a recent version of Git it
would work well, while if it would be used with an old version of Git
it would emit warnings. And these warnings might actually be more
annoying than the fact that the trailer is not put in the middle.

I might be wrong and there might have been other reasons though. Also
things might have changed since that time, as not many options if any
have been added since then.



[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