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

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

From
Jeff King <peff@peff.net>
Date
Nov 9, 2021, 16:35 UTC
Message-ID
<YYqjY/zcBWyqY8/5@coredump.intra.peff.net>

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.
 contrib/git-jump/README   | 3 +++
 contrib/git-jump/git-jump | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/contrib/git-jump/README b/contrib/git-jump/README
index 2f618a7f97..8bcace29d2 100644
--- a/contrib/git-jump/README
+++ b/contrib/git-jump/README
@@ -65,6 +65,9 @@ git jump diff --cached
 # jump to merge conflicts
 git jump merge
 
+# documentation conflicts are hard; skip past them for now
+git jump merge :^Documentation
+
 # jump to all instances of foo_bar
 git jump grep foo_bar
 
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 "$@" |
 	perl -pe 's/^.*?\t//' |
 	sort -u |
 	while IFS= read fn; do
-- 
2.34.0.rc1.634.g85d556ea55
Next: Taylor Blau
Message 1 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.