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

Re: [PATCH v2] bisect: Honor log.date

From
Jeff King <peff@peff.net>
Date
Apr 3, 2024, 01:27 UTC
Message-ID
<20240403012701.GC892394@coredump.intra.peff.net>
In-Reply-To
<xmqqmsqd9fse.fsf@gitster.g>
On Mon, Apr 01, 2024 at 10:03:13AM -0700, Junio C Hamano wrote:
Show 18 quoted lines
> >> That made me realize, if "git show" runs things through a pager, wouldn't it
> >> then lose the "%s is the first %s commit\n" message printed by
> >> bisect_next_all() before calling the function to show the contents?
> >> 
> >> Is that fixable?
> >
> > Good catch. IMHO we should disable the pager entirely by sticking
> > "--no-pager" at the front of the child argv. But then, maybe somebody
> > would like the output to be paged? I wouldn't.
> 
> Hardcoded --no-pager is a good workaround.  But if the output is
> long and needs paging, wouldn't we see what was shown before we
> spawned "less" on the screen when we quit it?  Running
> 
>     $ (echo message here ; git log --help)
> 
> and then saying 'q' to exit the pager leaves me "message" after that
> command line.

That depends on your "less" options and your terminal, I think. Aren't there some combinations where the terminal deinit sequence clears the screen? It has been a while since I've run into that, though, so I might be misremembering.

At any rate, my concerns are more:
  1. You wouldn't see it while the pager is active, so you are missing
     some context.
  2. If you don't use LESS=F, then it may be annoying to invoke the
     pager at all.
-Peff
Show 10 quoted lines
> > If we really wanted to keep the pager for git-show, I guess we'd need to
> > have it print the "%s is the first %s commit" message. The only way I
> > can think to do that is to pass it as a custom --format. But then we'd
> > need to additionally specify all of the usual "medium" format as a
> > custom format, too, which is quite ugly.
> 
> ;-)  Ugly but fun.
> 
> I wonder how hard it is to add %(default-output) placeholder for the
> pretty machinery.

I have a dream that all of the pretty formats could be implemented in terms of %-placeholders. But yeah, even without that, being able to do "%(pretty:medium)" would be cool. "Pretty" cool, even. (Sorry, I could not resist).

-Peff
Previous: Junio C HamanoNext: Christian Couder
Message 9 of 13 in “bisect: Honor log.date”
  1. bisect: Honor log.datePeter Krefting, Mar 30, 2024
  2. Junio C HamanoMar 31, 2024
  3. Peter KreftingMar 31, 2024
  4. Junio C HamanoMar 31, 2024
  5. Jeff KingApr 1, 2024
  6. Peter KreftingApr 1, 2024
  7. Jeff KingApr 1, 2024
  8. Junio C HamanoApr 1, 2024
  9. Jeff KingApr 3, 2024
  10. Christian CouderApr 16, 2024
  11. Junio C HamanoApr 16, 2024
  12. Peter KreftingApr 16, 2024
  13. Junio C HamanoApr 20, 2024

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.