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

Re: [PATCH v4] add-patch: response to unknown command

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 26, 2024, 05:39 UTC
Message-ID
<xmqqwmokbs3p.fsf@gitster.g>
In-Reply-To
<305296f1-975b-41b9-968c-3984d8056196@gmail.com>
Rubén Justo <rjusto@gmail.com> writes:
> The current options are:
>
> 	a.- make the test check for stderr and stdout, separatedly

There is a downside that we do not check what the users would see, as I mentioned in an earlier message.

> 	b.- fflush(stdout) in err
>
> 	c.- make err print to stdout
Yup.  The last one is what I showed in the thread.
Show 7 quoted lines
> I suspect that similar tests for other commands would produce similar
> errors, so (a) seems like an easy fix but feels like kicking the can
> forward.
>
> I'm not sure of the implications of (c).  Perhaps moving current
> messages to stdout breaks some workflow out there?  The other thread
> about disabling all hints has made me think.

That depends on "other" commands. As Phillip said, "git add -p" and the like that interacts with the end user via terminal, using a single stream, whether it is the standard error stream or the standard output stream, should not affect any end-user experience. It is very unlikely people capture only one stream and feed it to a program, and with i18n, these messages are not even designed for machine consumption in the first place.

> The (b) option seems to me the less disturbing change

Sticking close to the status quo would certainly _feel_ the safest at least in the shorter term.

But given that there is not really a reasonable justification why some output goes to the standard output stream while others go to the standard error stream in this program (note that I am specifically talking about the terminal interactive session with "add -p"), the approach will force us to worry about similar gotchas and we need to decide which stream the message needs to go every time we add a new one.

> but it has not attracted attention.

I think the same reasoning from the old thread that made us avoid the "flush() and keep writing to two streams" in the worktree code would apply here, too.

Previous: Rubén JustoNext: Junio C Hamano
Message 35 of 55 in “add-patch: response to invalid option”
  1. add-patch: response to invalid optionRubén Justo, Apr 15, 2024
  2. Patrick SteinhardtApr 16, 2024
  3. Rubén JustoApr 16, 2024
  4. phillip.wood123@gmail.comApr 16, 2024
  5. Rubén JustoApr 16, 2024
  6. phillip.wood123@gmail.comApr 17, 2024
  7. Junio C HamanoApr 17, 2024
  8. phillip.wood123@gmail.comApr 18, 2024
  9. Junio C HamanoApr 16, 2024
  10. Phillip WoodApr 16, 2024
  11. Junio C HamanoApr 16, 2024
  12. Phillip WoodApr 16, 2024
  13. Junio C HamanoApr 16, 2024
  14. Rubén JustoApr 16, 2024
  15. add-patch: response to invalid commandRubén Justo, Apr 20, 2024
  16. Junio C HamanoApr 20, 2024
  17. add-patch: response to unknown commandRubén Justo, Apr 21, 2024
  18. phillip.wood123@gmail.comApr 21, 2024
  19. Rubén JustoApr 21, 2024
  20. add-patch: response to unknown commandRubén Justo, Apr 21, 2024
  21. Junio C HamanoApr 22, 2024
  22. phillip.wood123@gmail.comApr 24, 2024
  23. Junio C HamanoApr 24, 2024
  24. Phillip WoodApr 29, 2024
  25. Junio C HamanoApr 29, 2024
  26. Jeff KingApr 25, 2024
  27. Eric SunshineApr 25, 2024
  28. Junio C HamanoApr 25, 2024
  29. Eric SunshineApr 25, 2024
  30. Junio C HamanoApr 25, 2024
  31. Junio C HamanoApr 25, 2024
  32. Rubén JustoApr 25, 2024
  33. Junio C HamanoApr 25, 2024
  34. Rubén JustoApr 25, 2024
  35. Junio C HamanoApr 26, 2024
  36. Junio C HamanoApr 26, 2024
  37. Jeff KingApr 26, 2024
  38. Rubén JustoApr 25, 2024
  39. Jeff KingApr 26, 2024
  40. Rubén JustoApr 26, 2024
  41. phillip.wood123@gmail.comApr 25, 2024
  42. 0/2 add-patch: response to unknown commandRubén Justo, Apr 29, 2024
  43. 1/2 add-patch: do not show UI messages on stderrRubén Justo, Apr 29, 2024
  44. Junio C HamanoApr 29, 2024
  45. Jeff KingApr 30, 2024
  46. Rubén JustoApr 30, 2024
  47. Junio C HamanoApr 30, 2024
  48. Junio C HamanoApr 30, 2024
  49. phillip.wood123@gmail.comApr 30, 2024
  50. Rubén JustoApr 30, 2024
  51. phillip.wood123@gmail.comMay 1, 2024
  52. Junio C HamanoMay 1, 2024
  53. Rubén JustoMay 1, 2024
  54. Junio C HamanoMay 2, 2024
  55. 2/2 add-patch: response to unknown commandRubén Justo, Apr 29, 2024

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.