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

Re: [PATCH (topgit) 1/2] Implement setup_pager just like in git

From
Kirill Smelkov <kirr@landau.phys.spbu.ru>
Date
Jan 8, 2009, 09:23 UTC
Message-ID
<20090108092304.GA4835@roro3>
In-Reply-To
<20090108020650.GC7345@lapse.rw.madduck.net>
On Thu, Jan 08, 2009 at 03:06:50PM +1300, martin f krafft wrote:
Show 12 quoted lines
> also sprach Kirill Smelkov <kirr@landau.phys.spbu.ru> [2009.01.08.1100 +1300]:
> > > So I suppose you could use
> > > 
> > >   ${GIT_PAGER-${PAGER-less}}
> > > 
> > > or similar.
> > 
> > Good eyes, thanks!
> > 
> > I'll rework it.
> 
> I am not 100% on this, but I think nested {}'s are a bashism.
It seems to be ok:

kirr@roro3:~$ dash $ unset GIT_PAGER $ unset PAGER $ echo ${GIT_PAGER-${PAGER-less}} less $ PAGER=more $ echo ${GIT_PAGER-${PAGER-less}} more $ GIT_PAGER='' $ echo ${GIT_PAGER-${PAGER-less}}

$ GIT_PAGER=/bin/cat $ echo ${GIT_PAGER-${PAGER-less}} /bin/cat

Show 10 quoted lines
> > On Wed, Jan 07, 2009 at 03:24:02PM +0100, Bert Wesarg wrote:
> > > On Wed, Jan 7, 2009 at 12:27, Kirill Smelkov <kirr@landau.phys.spbu.ru> wrote:
> > > > Martin, thanks for your review.
> > > > +       # atexit(close(1); wait pager)
> > > > +       trap "exec >&-; rm "$_pager_fifo"; rmdir "$_pager_fifo_dir"; wait" EXIT
> > > I think you need to escape the double quotes.
> > 
> > Good eyes -- corrected and thanks!
> 
> You could also just use single quotes inside the double quotes.
Thanks for the tip - I'll keep it in mind. Or is it the preferred way?

Thanks, Kirill

Previous: martin f krafftNext: Kirill Smelkov
Message 12 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.