Re: [PATCH v8 2/2] interpret_trailers: for three options parse add warning
- From
ZheNing Hu <adlternative@gmail.com>
- Date
- Mar 16, 2021, 09:11 UTC
- Message-ID
- <CAOLTT8Ti0+QJTUahUxOJ8fmq5aNTVnaSm1GyXaOJAAk3fD=49Q@mail.gmail.com>
- In-Reply-To
- <CAP8UFD0tgXi6Hq42dzsAAGMOhvLxqaUuBqex0CreyRb_XD5rxQ@mail.gmail.com>
Christian Couder <christian.couder@gmail.com> 于2021年3月16日周二 下午1:53写道:
Show 17 quoted lines
> 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. >
Well, this is indeed a situation I did not foresee. As a user, I don't see an error | warning reminder which may make me a little confused.
At the same time, some sub-command like `git cat-file`, If user give a wrong format:
$ git cat-file --batch-check="%(deltabases)"
git will tell us, "fatal: unknown format element: deltabases". It's easy for user to check.
> 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.
Thanks for your patiently explanation. If these warnings are really unnecessary, I will drop this patch.