"git -p cmd" to page anywhere
This allows you to say: git -p diff v2.6.16-rc5.. and the command pipes the output of any git command to your pager. [jc: this resurrects a month old RFC patch with improvement suggested by Linus to call it --paginate instead of --less.] Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
4
pager.c
4
pager.c
@ -5,6 +5,8 @@
|
||||
* something different on Windows, for example.
|
||||
*/
|
||||
|
||||
int pager_in_use;
|
||||
|
||||
static void run_pager(const char *pager)
|
||||
{
|
||||
execlp(pager, pager, NULL);
|
||||
@ -24,6 +26,8 @@ void setup_pager(void)
|
||||
else if (!*pager || !strcmp(pager, "cat"))
|
||||
return;
|
||||
|
||||
pager_in_use = 1; /* means we are emitting to terminal */
|
||||
|
||||
if (pipe(fd) < 0)
|
||||
return;
|
||||
pid = fork();
|
||||
|
||||
Reference in New Issue
Block a user