Skip to content

Commit

Permalink
Allow pager of diff command be enabled/disabled
Browse files Browse the repository at this point in the history
See for example, status and show commands. Besides,
Documentation/RelNotes-1.6.0.txt mentions that pager.<cmd>
can be used to enable/disable paging behavior per command.

Signed-off-by: Alex Riesen <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
raalkml authored and gitster committed Jul 23, 2008
1 parent 0dda1d1 commit 8f0359f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion builtin-diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,8 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
* If the user asked for our exit code then don't start a
* pager or we would end up reporting its exit code instead.
*/
if (!DIFF_OPT_TST(&rev.diffopt, EXIT_WITH_STATUS))
if (!DIFF_OPT_TST(&rev.diffopt, EXIT_WITH_STATUS) &&
check_pager_config("diff") != 0)
setup_pager();

/*
Expand Down
1 change: 1 addition & 0 deletions builtin.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ extern int fmt_merge_msg(int merge_summary, struct strbuf *in,
struct strbuf *out);
extern int commit_tree(const char *msg, unsigned char *tree,
struct commit_list *parents, unsigned char *ret);
extern int check_pager_config(const char *cmd);

extern int cmd_add(int argc, const char **argv, const char *prefix);
extern int cmd_annotate(int argc, const char **argv, const char *prefix);
Expand Down

0 comments on commit 8f0359f

Please sign in to comment.