git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Taylor Blau <me@ttaylorr.com>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] git-jump: pass "merge" arguments to ls-files
Date: Tue, 9 Nov 2021 11:46:26 -0500	[thread overview]
Message-ID: <YYql4uR39putmHP7@nand.local> (raw)
In-Reply-To: <YYqjY/zcBWyqY8/5@coredump.intra.peff.net>

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.

> diff --git a/contrib/git-jump/git-jump b/contrib/git-jump/git-jump
> index 931b0fe3a9..92dbd4cde1 100755
> --- a/contrib/git-jump/git-jump
> +++ b/contrib/git-jump/git-jump
> @@ -39,7 +39,7 @@ mode_diff() {
>  }
>
>  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`.

So I think that what you and I both wrote is least bad, but it does make
me cringe a little bit at being able to pass `--no-unmerged` to `git
jump merge`.

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.

Thanks,
Taylor

  reply	other threads:[~2021-11-09 16:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-09 16:35 [PATCH] git-jump: pass "merge" arguments to ls-files Jeff King
2021-11-09 16:46 ` Taylor Blau [this message]
2021-11-09 17:27   ` Jeff King

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=YYql4uR39putmHP7@nand.local \
    --to=me@ttaylorr.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /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).