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

Re: [PATCH 2/3] Allow isatty to be overriden with GIT_FORCE_TTY

From
AMAvishay Matayev <me@avishay.dev>
Date
Jul 9, 2021, 19:56 UTC
Message-ID
<CAJ-0OsxSXrgQE-Kn-DdbPTVZJ2V9+yiRug5mSyNQ096O+3fYww@mail.gmail.com>
In-Reply-To
<xmqqfswn72jj.fsf@gitster.g>
On Fri, 9 Jul 2021 at 21:41, Junio C Hamano <gitster@pobox.com> wrote:
Show 8 quoted lines
>
> If we want to force output to always go through the pager, we should
> call it "force pager", not "force tty".  If we want to always show
> progress bar no matter where the output goes, we should call it
> "force progress", not "force tty".  These should be controllable
> independenty, even though it is OK to have catch all "force
> everything" for convenience.
>

But using "force pager" or "force progress" is exactly the same as acknowledging that git uses tty for the output, as you'd have to know that the pager wouldn't open because there is no tty. The original implementation should've been to implement just the "force pager" logic but we've realised there are more places where git acts in a different way because of tty and I don't really see a reason those should be controlled individually, it will just create too many variables when the reason for their existence is the same, the absence of a tty.

Show 5 quoted lines
> There is no inherent reason why the output has to be passed through
> the pager when it goes to tty.  It merely is how we happen to have
> designed the heuristics.  We don't want to carve it in stone and
> expose it on end-users with a poorly chosen name.  Also, we do not
> want to tie multiple features unnecessarily.

I mean, git is pretty CLI centered, it isn't a library, so I'd say there is a pretty strong core reason for this design (at least that's how I see git). Unfortunately, when we want to use git in its not really CLI-like way, it acts unexpectedly.

Moreover, I really don't think this feature is intended for the regular git user, it will mostly help Fugitive or other programs that are built upon git's core, and those are most likely have to be familiar with git's implementation in one way or another.

Avishay
Previous: Junio C HamanoNext: Avishay Matayev
Message 11 of 13 in “Override isatty with GIT_FORCE_TTY”
  1. 0/3 Override isatty with GIT_FORCE_TTYAvishay Matayev, Jul 6, 2021
  2. 1/3 Change isatty's parameter to a *_FILENO defineAvishay Matayev, Jul 6, 2021
  3. Junio C HamanoJul 6, 2021
  4. Avishay MatayevJul 9, 2021
  5. 2/3 Allow isatty to be overriden with GIT_FORCE_TTYAvishay Matayev, Jul 6, 2021
  6. Junio C HamanoJul 6, 2021
  7. Avishay MatayevJul 9, 2021
  8. Junio C HamanoJul 9, 2021
  9. Avishay MatayevJul 9, 2021
  10. Junio C HamanoJul 9, 2021
  11. Avishay MatayevJul 9, 2021
  12. 3/3 Add tests for GIT_FORCE_TTYAvishay Matayev, Jul 6, 2021
  13. Avishay MatayevJul 30, 2021

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.