tg-patch: fix pagination
commitecea02402fc81f4e040e9d2108d161894a8ef5c1
authorKirill Smelkov <kirr@landau.phys.spbu.ru>
Wed, 21 Jan 2009 20:18:42 +0000 (21 23:18 +0300)
committermartin f. krafft <madduck@debian.org>
Fri, 23 Jan 2009 04:59:36 +0000 (23 15:59 +1100)
tree0238184740314f9a00c169436fc2cd7714ae5b93
parent992b652af325ad34b616ffc169016fbe7f659c96
tg-patch: fix pagination

Previously, when I was invoking `tg patch` the following used to happen:

1. .topmsg content was sent directly to _terminal_
2. for each file in the patch, its diff was generated with `git diff`
   and sent to *PAGER*
3. trailing 'tg: ...' was sent to terminal again

So the problem is that while `tg patch >file` works as expected, plain
`tg patch` does not -- in pager there is only a part of the whole patch
(first file diff) and header and trailer are ommitted.

I've finally decided to fix this inconvenience, and the way it works is
like in git -- we just hook `setup_pager` function in commands which
need to be paginated.

Signed-off-by: Kirill Smelkov <kirr@landau.phys.spbu.ru>
tg-patch.sh