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

Re: [PATCH] git-jump: pass "merge" arguments to ls-files

From
Taylor Blau <me@ttaylorr.com>
Date
Nov 9, 2021, 16:46 UTC
Message-ID
<YYql4uR39putmHP7@nand.local>
In-Reply-To
<YYqjY/zcBWyqY8/5@coredump.intra.peff.net>
On Tue, Nov 09, 2021 at 11:35:47AM -0500, Jeff King wrote:
Show 7 quoted lines
> 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.

Show 10 quoted lines
> 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

Previous: Jeff KingNext: Jeff King
Message 2 of 3 in “git-jump: pass "merge" arguments to ls-files”
  1. git-jump: pass "merge" arguments to ls-filesJeff King, Nov 9, 2021
  2. Taylor BlauNov 9, 2021
  3. Jeff KingNov 9, 2021

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.