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@xxxxxxxxx> --- 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