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

[PATCH] paginate git-diff by default

From
Martin Waitz <tali@admingilde.org>
Date
Oct 10, 2006, 19:16 UTC
Message-ID
<20061010191625.GF8612@admingilde.org>
In-Reply-To
<20061010181558.GB16972@spearce.org>
On Tue, Oct 10, 2006 at 02:15:58PM -0400, Shawn Pearce wrote:
Show 7 quoted lines
> Martin Waitz <tali@admingilde.org> wrote:
> > I always find myself typing "git -p diff".
> > Should we paginate git-diff output by default?
>
> I agree.  I'm very used to git log automatically running my $PAGER;
> I'm always surprised that git diff doesn't do the same when attached
> to my tty.
so here is the overly complex implementation:
---
diff --git a/git.c b/git.c
index 03acb25..3408e81 100644
--- a/git.c
+++ b/git.c
@@ -226,7 +226,7 @@ static void handle_internal_command(int
 		{ "check-ref-format", cmd_check_ref_format },
 		{ "commit-tree", cmd_commit_tree, RUN_SETUP },
 		{ "count-objects", cmd_count_objects, RUN_SETUP },
-		{ "diff", cmd_diff, RUN_SETUP },
+		{ "diff", cmd_diff, RUN_SETUP | USE_PAGER },
 		{ "diff-files", cmd_diff_files, RUN_SETUP },
 		{ "diff-index", cmd_diff_index, RUN_SETUP },
 		{ "diff-stages", cmd_diff_stages, RUN_SETUP },
-- 
Martin Waitz
Previous: Shawn PearceNext: Junio C Hamano
Message 3 of 5 in “paginate git-diff by default?”
  1. Martin WaitzOct 10, 2006
  2. Shawn PearceOct 10, 2006
  3. paginate git-diff by defaultMartin Waitz, Oct 10, 2006
  4. Junio C HamanoOct 11, 2006
  5. Johannes SchindelinOct 10, 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.