All of lore.kernel.org
 help / color / mirror / Atom feed
From: Taylor Blau <me@ttaylorr.com>
To: Patrick Steinhardt <ps@pks.im>
Cc: git@vger.kernel.org, Christian Couder <christian.couder@gmail.com>
Subject: Re: [PATCH] revision: make pseudo-opt flags read via stdin behave consistently
Date: Mon, 25 Sep 2023 18:47:18 -0400	[thread overview]
Message-ID: <ZRIN9gJsRgG4qj5r@nand.local> (raw)
In-Reply-To: <ZRGBo1TsgSYrMt01@tanuki>

On Mon, Sep 25, 2023 at 02:48:35PM +0200, Patrick Steinhardt wrote:
> > > diff --git a/Documentation/rev-list-options.txt b/Documentation/rev-list-options.txt
> > > index a4a0cb93b2..9bf13bac53 100644
> > > --- a/Documentation/rev-list-options.txt
> > > +++ b/Documentation/rev-list-options.txt
> > > @@ -151,6 +151,8 @@ endif::git-log[]
> > >  --not::
> > >  	Reverses the meaning of the '{caret}' prefix (or lack thereof)
> > >  	for all following revision specifiers, up to the next `--not`.
> > > +	When used on the command line before --stdin, the revisions passed
> > > +	through stdin will not be affected by it.
> >
> > Hmmph. This seems to change the behavior introduced by 42cabc341c4. Am I
> > reading this correctly that tips on stdin with '--not --stdin' would not
> > be marked as UNINTERESTING?
> >
> > (Reading this back, there are a lot of double-negatives in what I just
> > wrote making it confusing for me at least. What I'm getting at here is
> > that I think `--not --stdin` should mark tips given via stdin as
> > UNINTERESTING).
>
> It does not change the behaviour, it only documents the current state
> such that it's at least spelled out somewhere.

Sorry, I must have been confused when writing this :-<. Looking at it
again, I agree that the current behavior is that "--not --stdin" treats
any tips given over stdin as INTERESTING, so this documentation is
consistent with that.

> > I wonder if we could instead do something like:
> >
> >   - inherit the current set of psuedo-opts when processing input over
> >     `--stdin`
> >   - allow pseudo-opts within the context of `--stdin` arbitrarily
> >   - prevent those psuedo-opts applied while processing `--stdin` from
> >     leaking over to subsequent command-line arguments.
> >
> > Here's one approach for doing that, where we make a copy of the current
> > set of flags when calling `read_revisions_from_stdin()` instead of
> > passing a pointer to the global state.
>
> That was indeed my first approach. But this change would break behaviour
> that was introduced with 42cabc341c4 (Teach rev-list an option to read
> revs from the standard input., 2006-09-05) almost 17 years ago. If we
> change it now then this is very likely to cause problems somewhere.

Per above, you're absolutely right. I think that the patch that you
proposed here LGTM.

Thanks,
Taylor

  reply	other threads:[~2023-09-25 22:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-21 10:05 [PATCH] revision: make pseudo-opt flags read via stdin behave consistently Patrick Steinhardt
2023-09-21 18:45 ` Taylor Blau
2023-09-25 12:48   ` Patrick Steinhardt
2023-09-25 22:47     ` Taylor Blau [this message]
2023-09-21 19:04 ` Junio C Hamano
2023-09-25 12:51   ` Patrick Steinhardt
2023-09-25 13:02 ` [PATCH v2] " Patrick Steinhardt

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=ZRIN9gJsRgG4qj5r@nand.local \
    --to=me@ttaylorr.com \
    --cc=christian.couder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=ps@pks.im \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.