Re: [cogito] paged output for cg-diff

From: Michal Rokos <hidden>
Date: 2016-06-15 22:41:57

Hello,

Junio is right, following is sufficent. Tested with 'more' too.

 Michal

PS: I'm off the list, so please CC me.

Signed-off-by: Michal Rokos <redacted>
Idea-from: Junio C Hamano [off-list ref]

Index: cg-Xlib
===================================================================
--- ca5fef50fb68a3afbb35e1a48ac622f7a964f021/cg-Xlib  (mode:100755)
+++ uncommitted/cg-Xlib  (mode:100755)
@@ -91,3 +91,8 @@

 export BROKEN_MKTEMP=1
 del=$($(which mktemp) -t 2>/dev/null) && { rm $del; export BROKEN_MKTEMP=; }
+
+PAGER () {
+       ${PAGER:-less} ${PAGER_FLAGS:--R}
+}
+
Index: cg-diff
===================================================================
--- ca5fef50fb68a3afbb35e1a48ac622f7a964f021/cg-diff  (mode:100755)
+++ uncommitted/cg-diff  (mode:100755)
@@ -71,7 +71,7 @@
        # FIXME: Update ret based on what did we match. And take "$@"
        # to account after all.
        ret=
-       git-diff-cache -r -z $tree | xargs -0 ${COGITO_LIB}cg-Xdiffdo "$tree" uncommitted "$filter"
+       git-diff-cache -r -z $tree | xargs -0 ${COGITO_LIB}cg-Xdiffdo "$tree" uncommitted "$filter" | PAGER

        [ "$filter" ] && rm $filter
@@ -85,7 +85,7 @@

 [ "$id1" = "$id2" ] && die "trying to diff $id1 against itself"

-git-diff-tree -r -z $id1 $id2 | xargs -0 ${COGITO_LIB}cg-Xdiffdo $id1 $id2 "$filter"
+git-diff-tree -r -z $id1 $id2 | xargs -0 ${COGITO_LIB}cg-Xdiffdo $id1 $id2 "$filter" | PAGER

 [ "$filter" ] && rm $filter
 exit 0
Index: cg-log
===================================================================
--- ca5fef50fb68a3afbb35e1a48ac622f7a964f021/cg-log  (mode:100755)
+++ uncommitted/cg-log  (mode:100755)
@@ -181,4 +181,4 @@

                done
        echo
-done | ${PAGER:-less} ${PAGER_FLAGS:--R}
+done | PAGER
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help