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

'git diff HEAD' pager quirks

From
JGJeff Garzik <jeff@garzik.org>
Date
Dec 14, 2006, 22:01 UTC
Message-ID
<4581C9CA.5060207@garzik.org>
So, after a 'yum upgrade' brought me git-core-1.4.4.2-2.fc6, I 
discovered that "git diff HEAD" will produce paged output, if at a tty. 
  Nice, I like the improvement.

However, when there is no output at all (nothing dirty in working dir), "git diff HEAD" will sometimes invoke $PAGER ("/usr/bin/less" here) __anyway__.

This causes the cursor to jump down 20-30 lines, before returning the command prompt. Annoying. Example follows.

	Jeff

---------------------<begin BEFORE>---------------------------- [jgarzik@pretzel libata-dev]$ git diff HEAD [jgarzik@pretzel libata-dev]$ ---------------------<end BEFORE>------------------------------

---------------------<begin AFTER>----------------------------- [jgarzik@pretzel libata-dev]$ git diff HEAD

[jgarzik@pretzel libata-dev]$
Message 1 of 1 in “'git diff HEAD' pager quirks”
  1. Jeff GarzikDec 14, 2006

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.