diff mbox series

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

Message ID 20191221113846.169538-1-dev+git@drbeat.li (mailing list archive)
State New, archived
Headers show
Series [1/2] contrib/git-jump: extract function diff_to_quickfix | expand

Commit Message

Beat Bolli Dec. 21, 2019, 11:38 a.m. UTC
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 mbox series

Patch

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;