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

Re: CR codes from git commands

From
Daniel Barkalow <barkalow@iabervon.org>
Date
Jan 22, 2009, 07:46 UTC
Message-ID
<alpine.LNX.1.00.0901220238380.19665@iabervon.org>
In-Reply-To
<e38bce640901212334v1e672d48t81d5c81fecd929eb@mail.gmail.com>
On Wed, 21 Jan 2009, Brent Goodrick wrote:
Show 34 quoted lines
> On Wed, Jan 21, 2009 at 8:47 PM, Daniel Barkalow <barkalow@iabervon.org> wrote:
> > It's kind of unclear what you're trying to do here. I'm guessing that
> > you're trying to run git with stdio directed to a /dev/tty device, where
> > isatty() is true, but which doesn't interpret ASCII control characters as
> > such. We're not detecting that you can't use a pager on this, and so you
> > have to use PAGER=cat (which might not be a bad idea for things like
> > "man", either). With some clues about the environment, we should be able
> > to do something about this.
> >
> > You're also trying to send the progress output to a log file that you can
> > look at the end of (presumably in a more capable terminal). It should be
> > possible (with an option) to get git to output progress info to a non-tty,
> > and not use the CRs if the output isn't a tty.
> >
> > Or do you want to use a tty that can't handle CRs, and get newlines
> > instead of CRs? (If I'd git on the first computer I used, it would have
> > printed the progress bar over and over in place and probably torn a hole
> > in the paper, but I haven't used that one in over 20 years.)
> 
> Hi Daniel,
> 
> Ideally, yes I would want no CR's but LF's instead (but others who do
> not use my environment may actually like the way it is now, and I seek
> not to disturb that use case).  I could live without the progress
> lines (lines that print repeatedly over in one place on normal
> terminals), but adding " 2>&1 | cat" to every command line just to get
> the CR's to go away, is non-workable for me.
> 
> The environment I'm running git under is the Shell mode inside GNU
> Emacs. I can't tell you what type of terminal it is, because I believe
> that is defined deep in the guts of Emacs. Having read your reply
> above, I'm now wondering whether this is an Emacs issue versus a git
> issue. If it is an Emacs issue, then I am truly embarrassed for having
> wasted everyones time with it.

The terminal type, at least in my version of Emacs, is "dumb", which ought to be sufficient to tell git that a pager isn't going to be useful is most cases (might be worthwhile to keep "git log" from eating all your memory, though), and that using CR to rewrite lines isn't going to work.

	-Daniel
*This .sig left intentionally blank*
Previous: Brent GoodrickNext: Junio C Hamano
Message 5 of 24 in “CR codes from git commands”
  1. Brent GoodrickJan 20, 2009
  2. Johannes SchindelinJan 20, 2009
  3. Daniel BarkalowJan 22, 2009
  4. Brent GoodrickJan 22, 2009
  5. Daniel BarkalowJan 22, 2009
  6. Junio C HamanoJan 22, 2009
  7. Mike RalphsonJan 22, 2009
  8. Brent GoodrickJan 22, 2009
  9. Mike RalphsonJan 22, 2009
  10. Johannes SchindelinJan 22, 2009
  11. Daniel BarkalowJan 22, 2009
  12. Johannes SchindelinJan 22, 2009
  13. Brent GoodrickJan 23, 2009
  14. Junio C HamanoJan 23, 2009
  15. Johannes SchindelinJan 23, 2009
  16. Brent GoodrickJan 24, 2009
  17. Johannes SchindelinJan 24, 2009
  18. Boyd Stephen Smith Jr.Jan 25, 2009
  19. Brent GoodrickJan 25, 2009
  20. Brent GoodrickFeb 2, 2009
  21. The lifecycle of a patch and the maintainer involvementJunio C Hamano, Jan 25, 2009
  22. Brent GoodrickJan 21, 2009
  23. Johannes SchindelinJan 21, 2009
  24. Brent GoodrickJan 22, 2009

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.