Skip to contentSkip to conversation

paginate git-diff by default?

PATCH In review Martin Waitz 4 participants 5 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

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

Signature · 1 line
Martin Waitz
#1 lore raw
Quoted 7 lines · Martin Waitz

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.

Signature · 1 line
Shawn.
#2 lore raw

PATCH 1/1 paginate git-diff by default

Quoted 7 lines · Shawn Pearce
Quoted 2 lines · Martin Waitz

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:

---

git.c +1 -1
index 03acb25..3408e81 100644
@@ -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 },
Signature · 1 line
Martin Waitz
#3 lore raw

Re: [PATCH] paginate git-diff by default

Quoted 8 lines · Martin Waitz
Quoted 7 lines · Shawn Pearce
Quoted 2 lines · Martin Waitz

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.