threads / discuss / 5874

paginate git-diff by default?

Subject: paginate git-diff by default?

## tl;dr

5 messages between Oct 10, 2006 and Oct 11, 2006.

replies: 4people: 4as markdown or json

Martin Waitz· Oct 10, 2006, 18:13 UTC · lore
hoi :)

I always find myself typing "git -p diff". Should we paginate git-diff output by default?

I was sure this was discussed before but I could not immediately find it, so I'm simply asking again ;-).

-- 
Martin Waitz
Shawn Pearce· Oct 10, 2006, 18:15 UTC · re: Martin Waitz · lore

Re: paginate git-diff by default?

Martin Waitz <tali@admingilde.org> wrote:
Show 7 quoted lines
> hoi :)
> 
> I always find myself typing "git -p diff".
> Should we paginate git-diff output by default?
> 
> I was sure this was discussed before but I could not immediately
> find it, so I'm simply asking again ;-).

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.

-- 
Shawn.
Martin Waitz· Oct 10, 2006, 19:16 UTC · re: Shawn Pearce · lore

[PATCH] paginate git-diff by default

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
Junio C Hamano· Oct 11, 2006, 00:57 UTC · re: Martin Waitz · lore

Re: [PATCH] paginate git-diff by default

Martin Waitz <tali@admingilde.org> writes:
Show 8 quoted lines
> On Tue, Oct 10, 2006 at 02:15:58PM -0400, Shawn Pearce wrote:
>> 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.
Hmm.  So close to 1.4.3...  Will take it.

← back to recent threads