@matheusbsbs / matheus-bagliano / commits / 8f0359f0a6
Fork 0

Allow pager of diff command be enabled/disabled

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 <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Alex Riesen committed Jul 21, 2008 at 23:28 UTC 8f0359f0a611fef9840218ba61162e9916124e89
2 files changed +3 -1
builtin-diff.c
+2 -1
@@ -296,7 +296,8 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
296 * If the user asked for our exit code then don't start a
297 * pager or we would end up reporting its exit code instead.
298 */
299 - if (!DIFF_OPT_TST(&rev.diffopt, EXIT_WITH_STATUS))
299 + if (!DIFF_OPT_TST(&rev.diffopt, EXIT_WITH_STATUS) &&
300 + check_pager_config("diff") != 0)
301 setup_pager();
302
303 /*
builtin.h
+1
@@ -18,6 +18,7 @@ extern int fmt_merge_msg(int merge_summary, struct strbuf *in,
18 struct strbuf *out);
19 extern int commit_tree(const char *msg, unsigned char *tree,
20 struct commit_list *parents, unsigned char *ret);
21 +extern int check_pager_config(const char *cmd);
22
23 extern int cmd_add(int argc, const char **argv, const char *prefix);
24 extern int cmd_annotate(int argc, const char **argv, const char *prefix);