# paginate git-diff by default?

5 messages from 2006-10-10 to 2006-10-11. Participants: Martin Waitz, Shawn Pearce, Johannes Schindelin, Junio C Hamano.
Thread: https://gitlist.dev/t/5874

## Martin Waitz, 2006-10-10 18:13

Subject: paginate git-diff by default?
Message-ID: <20061010181337.GE8612@admingilde.org>
URL: https://gitlist.dev/e/20061010181337.GE8612%40admingilde.org

```
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, 2006-10-10 18:15

Subject: Re: paginate git-diff by default?
Message-ID: <20061010181558.GB16972@spearce.org>
URL: https://gitlist.dev/e/20061010181558.GB16972%40spearce.org
In-Reply-To: <20061010181337.GE8612@admingilde.org>

```
Martin Waitz <tali@admingilde.org> wrote:
> 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.

```

## Johannes Schindelin, 2006-10-10 19:06

Subject: Re: paginate git-diff by default?
Message-ID: <Pine.LNX.4.63.0610102104210.14200@wbgn013.biozentrum.uni-wuerzburg.de>
URL: https://gitlist.dev/e/Pine.LNX.4.63.0610102104210.14200%40wbgn013.biozentrum.uni-wuerzburg.de
In-Reply-To: <20061010181337.GE8612@admingilde.org>

```
Hi,

On Tue, 10 Oct 2006, Martin Waitz wrote:

> I always find myself typing "git -p diff".

I don't. Because I have an alias "pd" for that on all of my machines. ;')

Ciao,
Dscho

```

## Martin Waitz, 2006-10-10 19:16

Subject: [PATCH] paginate git-diff by default
Message-ID: <20061010191625.GF8612@admingilde.org>
URL: https://gitlist.dev/e/20061010191625.GF8612%40admingilde.org
In-Reply-To: <20061010181558.GB16972@spearce.org>

```
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.

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, 2006-10-11 00:57

Subject: Re: [PATCH] paginate git-diff by default
Message-ID: <7vwt77y8h5.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vwt77y8h5.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <20061010191625.GF8612@admingilde.org>

```
Martin Waitz <tali@admingilde.org> writes:

> 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.

```
