{"thread":{"id":"56862","subject":"[PATCH] git-jump: pass \"merge\" arguments to ls-files","startedAt":"2021-11-09T16:35:50Z","lastAt":"2021-11-09T17:28:02Z","messageCount":3,"participants":["Jeff King","Taylor Blau"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"440748","messageId":"YYqjY/zcBWyqY8/5@coredump.intra.peff.net","threadId":"56862","inReplyTo":null,"subject":"[PATCH] git-jump: pass \"merge\" arguments to ls-files","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2021-11-09T16:35:47Z","receivedAt":"2021-11-09T16:35:50Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"We currently throw away any arguments given to \"git jump merge\". We\nshould instead pass them along to ls-files, since they're likely to be\npathspecs. This matches the behavior of \"git jump diff\", etc.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\nJust a little wart I noticed while doing a really tricky merge today.\n\n contrib/git-jump/README   | 3 +++\n contrib/git-jump/git-jump | 2 +-\n 2 files changed, 4 insertions(+), 1 deletion(-)\n\ndiff --git a/contrib/git-jump/README b/contrib/git-jump/README\nindex 2f618a7f97..8bcace29d2 100644\n--- a/contrib/git-jump/README\n+++ b/contrib/git-jump/README\n@@ -65,6 +65,9 @@ git jump diff --cached\n # jump to merge conflicts\n git jump merge\n \n+# documentation conflicts are hard; skip past them for now\n+git jump merge :^Documentation\n+\n # jump to all instances of foo_bar\n git jump grep foo_bar\n \ndiff --git a/contrib/git-jump/git-jump b/contrib/git-jump/git-jump\nindex 931b0fe3a9..92dbd4cde1 100755\n--- a/contrib/git-jump/git-jump\n+++ b/contrib/git-jump/git-jump\n@@ -39,7 +39,7 @@ mode_diff() {\n }\n \n mode_merge() {\n-\tgit ls-files -u |\n+\tgit ls-files -u \"$@\" |\n \tperl -pe 's/^.*?\\t//' |\n \tsort -u |\n \twhile IFS= read fn; do\n-- \n2.34.0.rc1.634.g85d556ea55\n"},{"id":"440750","messageId":"YYql4uR39putmHP7@nand.local","threadId":"56862","inReplyTo":"YYqjY/zcBWyqY8/5@coredump.intra.peff.net","subject":"Re: [PATCH] git-jump: pass \"merge\" arguments to ls-files","fromName":"Taylor Blau","fromEmail":"me@ttaylorr.com","sentAt":"2021-11-09T16:46:26Z","receivedAt":"2021-11-09T16:46:39Z","isPatch":true,"sender":{"key":"me@ttaylorr.com","avatar":"https://avatars.githubusercontent.com/u/301000140?v=4"},"body":"On Tue, Nov 09, 2021 at 11:35:47AM -0500, Jeff King wrote:\n> We currently throw away any arguments given to \"git jump merge\". We\n> should instead pass them along to ls-files, since they're likely to be\n> pathspecs. This matches the behavior of \"git jump diff\", etc.\n>\n> Signed-off-by: Jeff King <peff@peff.net>\n> ---\n> Just a little wart I noticed while doing a really tricky merge today.\n\nThis is hilarious to me, because I wrote the exact same patch to skip\nsome conflicts while resolving what I can only assume is the same merge.\n\n> diff --git a/contrib/git-jump/git-jump b/contrib/git-jump/git-jump\n> index 931b0fe3a9..92dbd4cde1 100755\n> --- a/contrib/git-jump/git-jump\n> +++ b/contrib/git-jump/git-jump\n> @@ -39,7 +39,7 @@ mode_diff() {\n>  }\n>\n>  mode_merge() {\n> -\tgit ls-files -u |\n> +\tgit ls-files -u \"$@\" |\n\nIt's kind of unfortunate (maybe not?) that a caller could now run:\n\n    git jump merge --no-unmerged\n\nand get the same results albeit *much* slower. We could limit ourselves\nto only accepting pathspecs (by writing `git ls-files -u -- \"$@\"`), but\nthat feels overly restrictive. We could also say `\"$@\" -u`, but that\nbreaks if the caller writes `--` or `--end-of-options`.\n\nSo I think that what you and I both wrote is least bad, but it does make\nme cringe a little bit at being able to pass `--no-unmerged` to `git\njump merge`.\n\nAnyway, I know that it's late in the -rc cycle, but I'd be happy to see\nsomething like this get picked up once Junio tags 2.34 and we have\nstabilized a little bit.\n\nThanks,\nTaylor\n"},{"id":"440753","messageId":"YYqvn1JeZlQbxlJl@coredump.intra.peff.net","threadId":"56862","inReplyTo":"YYql4uR39putmHP7@nand.local","subject":"Re: [PATCH] git-jump: pass \"merge\" arguments to ls-files","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2021-11-09T17:27:59Z","receivedAt":"2021-11-09T17:28:02Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Nov 09, 2021 at 11:46:26AM -0500, Taylor Blau wrote:\n\n> On Tue, Nov 09, 2021 at 11:35:47AM -0500, Jeff King wrote:\n> > We currently throw away any arguments given to \"git jump merge\". We\n> > should instead pass them along to ls-files, since they're likely to be\n> > pathspecs. This matches the behavior of \"git jump diff\", etc.\n> >\n> > Signed-off-by: Jeff King <peff@peff.net>\n> > ---\n> > Just a little wart I noticed while doing a really tricky merge today.\n> \n> This is hilarious to me, because I wrote the exact same patch to skip\n> some conflicts while resolving what I can only assume is the same merge.\n\nIt's possible. :)\n\n> >  mode_merge() {\n> > -\tgit ls-files -u |\n> > +\tgit ls-files -u \"$@\" |\n> \n> It's kind of unfortunate (maybe not?) that a caller could now run:\n> \n>     git jump merge --no-unmerged\n> \n> and get the same results albeit *much* slower. We could limit ourselves\n> to only accepting pathspecs (by writing `git ls-files -u -- \"$@\"`), but\n> that feels overly restrictive. We could also say `\"$@\" -u`, but that\n> breaks if the caller writes `--` or `--end-of-options`.\n\nYeah. With \"git jump diff\" and \"git jump grep\", it's an explicit feature\nthat we allow extra arguments. That's less likely here, though you could\nperhaps do something clever with --recurse-submodules, etc. And while\nyou could royally screw things up with \"--no-unmerged\", I think this is\na case of \"if it hurts, don't do it\".\n\n> Anyway, I know that it's late in the -rc cycle, but I'd be happy to see\n> something like this get picked up once Junio tags 2.34 and we have\n> stabilized a little bit.\n\nYeah, obviously no rush at all on this.\n\n-Peff\n"}]}