From: Taylor Blau <me@ttaylorr.com>
To: Jeff King <peff@peff.net>
Cc: Philip Yung <y5c4l3@proton.me>,
Y5 via GitGitGadget <gitgitgadget@gmail.com>,
git@vger.kernel.org
Subject: Re: [PATCH] diff: setup pager only before diff contents truly ready
Date: Mon, 21 Oct 2024 15:38:17 -0400 [thread overview]
Message-ID: <ZxatqdBiB+NoMP+j@nand.local> (raw)
In-Reply-To: <20241021190045.GB1219228@coredump.intra.peff.net>
On Mon, Oct 21, 2024 at 03:00:45PM -0400, Jeff King wrote:
> So I think in an ideal world we'd:
>
> - convert those two commands to do the pager setup themselves and
> retire the USE_PAGER flag entirely
>
> - move configured pager handling down into more commands. So git-log
> should set DELAY_PAGER_CONFIG and then call setup_auto_pager()
> rather than setup_pager(). Ideally DELAY_PAGER_CONFIG would be the
> default, but we can't do that until every builtin makes its own call
> to setup_auto_pager() at the right moment.
>
> - push calls to setup_pager() (or setup_auto_pager()) as far down
> within commands as possible (right before we start generating
> output). Your patch does that for git-diff, but there may be other
> cases.
>
> - consistently handle pager config whether USE_SETUP is set or not.
> That means git-diff should set DELAY_PAGER_CONFIG, since it handles
> the pager itself.
>
> And that would make things more consistent overall, and avoid pushing
> early errors into the pager (though of course it would still be possible
> to get some errors in the pager if they happen after we start it).
>
> I don't blame you if you don't want to start down that rabbit hole. :) I
> think it would probably be OK to peck away at it incrementally, and your
> patch does that.
Nicely put. I think what's nice about the patch here is that it starts
us down that direction you outlined above, so we'd want it regardless of
how much of the rest of the work Y5 is willing to do.
> > > would be missing a spot that needed a new setup_diff_pager() call, and I
> > > suspect we don't have good test coverage here.
> >
> > This is actually my concern as well when I was naively testing the coverage
> > using GDB, which turned out to be quite tedious. Would you consider it's fine to
> > add a pager consistency test for builtins, probably in another patch with regard
> > to `t7006-pager.sh` OR a new test `t7007`?
>
> TBH, I am not all that worried about adding tests just for your patch.
> You'd need to identify all of the possible diff code paths in order to
> add tests for them, which is the same thing you had to do to fix the
> code paths. I was mostly just commenting that we're not likely to be
> able to rely on existing tests to help us here.
>
> It might be worth adding a test that shows off your improved diff
> behavior, though I would be OK if it was a representative command and
> not exhaustive. I think adding to t7006 should be fine.
Agreed.
Thanks,
Taylor
next prev parent reply other threads:[~2024-10-21 19:38 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-19 20:39 [PATCH] diff: setup pager only before diff contents truly ready Y5 via GitGitGadget
2024-10-19 20:57 ` Kristoffer Haugsbakk
2024-10-21 0:17 ` Philip Yung
2024-10-19 21:19 ` Jeff King
2024-10-21 0:11 ` Philip Yung
2024-10-21 19:00 ` Jeff King
2024-10-21 19:38 ` Taylor Blau [this message]
2024-11-18 0:55 ` Junio C Hamano
2024-11-25 11:31 ` Jeff King
2024-12-03 5:33 ` Junio C Hamano
2024-12-03 21:24 ` Jeff King
2024-12-04 0:18 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZxatqdBiB+NoMP+j@nand.local \
--to=me@ttaylorr.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=peff@peff.net \
--cc=y5c4l3@proton.me \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).