All of lore.kernel.org
 help / color / mirror / Atom feed
From: Beat Bolli <dev+git@drbeat.li>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org, Beat Bolli <dev+git@drbeat.li>
Subject: [PATCH 1/2] contrib/git-jump: extract function diff_to_quickfix
Date: Sat, 21 Dec 2019 12:38:45 +0100	[thread overview]
Message-ID: <20191221113846.169538-1-dev+git@drbeat.li> (raw)

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


             reply	other threads:[~2019-12-21 11:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-21 11:38 Beat Bolli [this message]
2019-12-21 11:38 ` [PATCH 2/2] contrib/git-jump: add mode commit Beat Bolli
2019-12-21 19:23   ` Jeff King
2019-12-22 12:47     ` Beat Bolli
2019-12-22 12:47       ` Beat Bolli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191221113846.169538-1-dev+git@drbeat.li \
    --to=dev+git@drbeat.li \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.