Re: [RFC PATCH 0/6] Add gentle alternative for `get_oid()`
- From
Paul-Sebastian Ungureanu <ungureanupaulsebastian@gmail.com>
- Date
- Jul 18, 2018, 23:03 UTC
- Message-ID
- <8ebfad3c-7009-d0cc-2ef8-54ebac6783f9@gmail.com>
- In-Reply-To
- <CACsJy8AEDmyg1XpgXc5KgKdG33t2SeOHw56tEgL_VVXh1Bcprg@mail.gmail.com>
Hello,
On 17.07.2018 20:45, Duy Nguyen wrote:
Show 5 quoted lines
> Since get_oid() callers must handle failure when it returns non-zero, > I would say "gently" is already implied by get_oid() and we could just > convert those die() to error() or warning(). Unless some of those > die() are very special that we need to choose which call sites should > go "even gentler" where some sites should still die()?
Of course, "gently" is already implied by `get_oid()` to some extent.
From the beginning I tried to follow the safer method to do that. Changing `die()` into `error()` or `warning()` and handling the error in the caller function not only would mean a harder patch to read, but could also introduce some regressions since some of the functions in the call graph of `get_oid()` are used by other functions as well.
I think that it might be a good idea, but I am not entirely sure. The codebase is pretty complex and this might make it harder to follow. I am not able to give a clear answer, but thank you for taking time to look over these patches!
Best, Paul