git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH (topgit) 2/2] tg-patch: fix pagination

From
Kirill Smelkov <kirr@landau.phys.spbu.ru>
Date
Jan 6, 2009, 15:16 UTC
Message-ID
<7c756270cdd997037616e1601121347b73b2bc77.1231254832.git.kirr@landau.phys.spbu.ru>
In-Reply-To
<cover.1231254832.git.kirr@landau.phys.spbu.ru>
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 |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/tg-patch.sh b/tg-patch.sh
index a704375..dc699d2 100644
--- a/tg-patch.sh
+++ b/tg-patch.sh
@@ -24,6 +24,9 @@ done
 base_rev="$(git rev-parse --short --verify "refs/top-bases/$name" 2>/dev/null)" ||
 	die "not a TopGit-controlled branch"
 
+
+setup_pager
+
 git cat-file blob "$name:.topmsg"
 echo
 [ -n "$(git grep '^[-]--' "$name" -- ".topmsg")" ] || echo '---'
-- 
1.6.1.48.ge9b8
Previous: Kirill SmelkovNext: Kirill Smelkov
Message 13 of 14 in “tg-patch: fix pagination”
  1. 0/2 tg-patch: fix paginationKirill Smelkov, Jan 6, 2009
  2. 1/2 Implement setup_pager just like in gitKirill Smelkov, Jan 6, 2009
  3. martin f krafftJan 6, 2009
  4. Adeodato SimóJan 7, 2009
  5. Kirill SmelkovJan 7, 2009
  6. Thomas RastJan 7, 2009
  7. Bert WesargJan 7, 2009
  8. Pierre HabouzitJan 7, 2009
  9. Petr BaudisJan 7, 2009
  10. Kirill SmelkovJan 7, 2009
  11. martin f krafftJan 8, 2009
  12. Kirill SmelkovJan 8, 2009
  13. 2/2 tg-patch: fix paginationKirill Smelkov, Jan 6, 2009
  14. Kirill SmelkovJan 18, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.