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

[PATCH 1/2] contrib/git-jump: extract function diff_to_quickfix

From
Beat Bolli <dev+git@drbeat.li>
Date
Dec 21, 2019, 11:38 UTC
Message-ID
<20191221113846.169538-1-dev+git@drbeat.li>

In preparation for a new mode that will also jump to diff hunks, extract the function that generates the quickfix list from a diff.

Signed-off-by: Beat Bolli <dev+git@drbeat.li>
---
 contrib/git-jump/git-jump | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
 mode change 100755 => 100644 contrib/git-jump/git-jump
diff --git a/contrib/git-jump/git-jump b/contrib/git-jump/git-jump
old mode 100755
new mode 100644
index 931b0fe3a9..776fa90f7f
--- a/contrib/git-jump/git-jump
+++ b/contrib/git-jump/git-jump
@@ -24,7 +24,10 @@ open_editor() {
 }
 
 mode_diff() {
-	git diff --no-prefix --relative "$@" |
+	git diff --no-prefix --relative "$@" | diff_to_quickfix
+}
+
+diff_to_quickfix() {
 	perl -ne '
 	if (m{^\+\+\+ (.*)}) { $file = $1; next }
 	defined($file) or next;
-- 
2.21.0.1020.gf2820cf01a
Next: Beat Bolli
Message 1 of 4 in “contrib/git-jump: extract function diff_to_quickfix”
  1. 1/2 contrib/git-jump: extract function diff_to_quickfixBeat Bolli, Dec 21, 2019
  2. 2/2 contrib/git-jump: add mode commitBeat Bolli, Dec 21, 2019
  3. Jeff KingDec 21, 2019
  4. Beat BolliDec 22, 2019

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.