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

Re: [PATCH 0/7] [RFC] advice: refuse to output if stderr not TTY

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 22, 2024, 16:25 UTC
Message-ID
<xmqqcym0sexi.fsf@gitster.g>
In-Reply-To
<e90949ed-8065-4498-9ddb-3d5c6afa7b35@gmail.com>
Derrick Stolee <stolee@gmail.com> writes:
Show 14 quoted lines
> On 8/21/24 7:02 AM, Derrick Stolee via GitGitGadget wrote:
>> Advice is supposed to be for humans, not machines. Why do we output it when
>> stderr is not a terminal? Let's stop doing that.
>> I'm labeling this as an RFC because I believe there is some risk
>> with this
>> change. 
>
> Thanks, all, for the feedback about the risk of making such a change. I
> agree that we should not pursue this direction.
>
> The main issues are:
>
>  1. Some tools create a wrapper around Git and may want to supply the
>     advice to the user by parsing stderr.
Or they may just pass it through to the user without even parsing.
Show 9 quoted lines
>  2. The advice system has been on for a long time and we cannot know
>     where other dependencies could be for it.
>
> I'll abandon this RFC, but plan on the following action items:
>
>  * Document GIT_ADVICE in Documentation/git.exe.
>
>  * Modify Documentation/config/advice.txt to mention GIT_ADVICE and
>    recommend that automated tools calling Git commands set it to zero.

FWIW, not documenting it was very much deliberate to discourage folks placing it in their ~/.login file. I am OK with the above as long as "this is for tools" is stressed well enough.

Previous: Derrick Stolee
Message 15 of 15 in “[RFC] advice: refuse to output if stderr not TTY”
  1. 0/7 [RFC] advice: refuse to output if stderr not TTYDerrick Stolee via GitGitGadget, Aug 21, 2024
  2. 1/7 t1000-2000: add GIT_ADVICE=1 for advice testsDerrick Stolee via GitGitGadget, Aug 21, 2024
  3. 2/7 t3000-4000: add GIT_ADVICE=1 to advice testsDerrick Stolee via GitGitGadget, Aug 21, 2024
  4. 3/7 t5000: add GIT_ADVICE=1 to advice testsDerrick Stolee via GitGitGadget, Aug 21, 2024
  5. 4/7 t6000: add GIT_ADVICE=1 to advice testsDerrick Stolee via GitGitGadget, Aug 21, 2024
  6. 5/7 t7000: add GIT_ADVICE=1 to advice testsDerrick Stolee via GitGitGadget, Aug 21, 2024
  7. 6/7 t7508/12: set GIT_ADVICE=1 across all testsDerrick Stolee via GitGitGadget, Aug 21, 2024
  8. 7/7 advice: refuse to output if stderr not TTYDerrick Stolee via GitGitGadget, Aug 21, 2024
  9. Jeff KingAug 21, 2024
  10. Junio C HamanoAug 21, 2024
  11. Junio C HamanoAug 21, 2024
  12. Patrick SteinhardtAug 22, 2024
  13. Gabor GombasAug 22, 2024
  14. Derrick StoleeAug 22, 2024
  15. Junio C HamanoAug 22, 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.