git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v3 2/5] ref-filter: add return value && strbuf to handlers

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 19, 2018, 19:24 UTC
Message-ID
<xmqqbmfjvpgm.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<010201623e59448f-2db7a920-fe77-481a-b105-de6bbff253eb-000000@eu-west-1.amazonses.com>
Olga Telezhnaya <olyatelezhnaya@gmail.com> writes:
> Continue removing any printing from ref-filter formatting logic,
> so that it could be more general.

"more general" sounds overly broad. Is this to avoid calling die() so that the caller can decide what error messages it wants to give, abort operation or not, etc.? From a quick scan of the patch, I have a feeling that "any printing" is not the problem you are solving (calling die() is).

> Change the signature of handlers by adding return value
> and strbuf parameter for errors.

Could you explain what the "return value" means? We can see from the patch that the function signature is being changed by the patch. What needs human explanation is why and what the values mean, e.g. "to allow the caller to notice an error, the function returns 0 upon success and non-0 upon failure, and an error message is appended to the strbuf *err" (don't pay too much attention to "0" or "non-0" in this example, as I do not know what you chose to assign the return values to signal what to the callers; this is merely to illustrate the degree of details I would expect).

Thanks.
Previous: Olga TelezhnayaNext: Olga Telezhnaya
Message 18 of 30 in “ref-filter: start adding strbufs with errors”
  1. 1/5 ref-filter: start adding strbufs with errorsOlga Telezhnaya, Mar 14, 2018
  2. 5/5 ref-filter: get_ref_atom_value() error handlingOlga Telezhnaya, Mar 14, 2018
  3. Martin ÅgrenMar 15, 2018
  4. Eric SunshineMar 15, 2018
  5. Оля ТележнаяMar 16, 2018
  6. Junio C HamanoMar 15, 2018
  7. Оля ТележнаяMar 16, 2018
  8. 3/5 ref-filter: change parsing function error handlingOlga Telezhnaya, Mar 14, 2018
  9. Junio C HamanoMar 15, 2018
  10. Оля ТележнаяMar 16, 2018
  11. 4/5 ref-filter: add return value to parsersOlga Telezhnaya, Mar 14, 2018
  12. 2/5 ref-filter: add return value && strbuf to handlersOlga Telezhnaya, Mar 14, 2018
  13. 1/5 ref-filter: start adding strbufs with errorsOlga Telezhnaya, Mar 19, 2018
  14. 3/5 ref-filter: change parsing function error handlingOlga Telezhnaya, Mar 19, 2018
  15. Junio C HamanoMar 19, 2018
  16. 5/5 ref-filter: get_ref_atom_value() error handlingOlga Telezhnaya, Mar 19, 2018
  17. 2/5 ref-filter: add return value && strbuf to handlersOlga Telezhnaya, Mar 19, 2018
  18. Junio C HamanoMar 19, 2018
  19. 4/5 ref-filter: add return value to parsersOlga Telezhnaya, Mar 19, 2018
  20. 1/5 ref-filter: start adding strbufs with errorsOlga Telezhnaya, Mar 20, 2018
  21. 5/5 ref-filter: get_ref_atom_value() error handlingOlga Telezhnaya, Mar 20, 2018
  22. Eric SunshineMar 20, 2018
  23. Junio C HamanoMar 20, 2018
  24. Eric SunshineMar 20, 2018
  25. Junio C HamanoMar 21, 2018
  26. Eric SunshineMar 21, 2018
  27. 3/5 ref-filter: change parsing function error handlingOlga Telezhnaya, Mar 20, 2018
  28. 2/5 ref-filter: add return value && strbuf to handlersOlga Telezhnaya, Mar 20, 2018
  29. Eric SunshineMar 20, 2018
  30. 4/5 ref-filter: add return value to parsersOlga Telezhnaya, Mar 20, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.