Re: [PATCH] git-jump: pass "merge" arguments to ls-files
- From
Jeff King <peff@peff.net>
- Date
- Nov 9, 2021, 17:27 UTC
- Message-ID
- <YYqvn1JeZlQbxlJl@coredump.intra.peff.net>
- In-Reply-To
- <YYql4uR39putmHP7@nand.local>
On Tue, Nov 09, 2021 at 11:46:26AM -0500, Taylor Blau wrote:
Show 11 quoted lines
> On Tue, Nov 09, 2021 at 11:35:47AM -0500, Jeff King wrote: > > We currently throw away any arguments given to "git jump merge". We > > should instead pass them along to ls-files, since they're likely to be > > pathspecs. This matches the behavior of "git jump diff", etc. > > > > Signed-off-by: Jeff King <peff@peff.net> > > --- > > Just a little wart I noticed while doing a really tricky merge today. > > This is hilarious to me, because I wrote the exact same patch to skip > some conflicts while resolving what I can only assume is the same merge.
It's possible. :)
Show 12 quoted lines
> > mode_merge() {
> > - git ls-files -u |
> > + git ls-files -u "$@" |
>
> It's kind of unfortunate (maybe not?) that a caller could now run:
>
> git jump merge --no-unmerged
>
> and get the same results albeit *much* slower. We could limit ourselves
> to only accepting pathspecs (by writing `git ls-files -u -- "$@"`), but
> that feels overly restrictive. We could also say `"$@" -u`, but that
> breaks if the caller writes `--` or `--end-of-options`.Yeah. With "git jump diff" and "git jump grep", it's an explicit feature that we allow extra arguments. That's less likely here, though you could perhaps do something clever with --recurse-submodules, etc. And while you could royally screw things up with "--no-unmerged", I think this is a case of "if it hurts, don't do it".
> Anyway, I know that it's late in the -rc cycle, but I'd be happy to see > something like this get picked up once Junio tags 2.34 and we have > stabilized a little bit.
Yeah, obviously no rush at all on this.
-Peff