git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] contrib/git-jump: extract function diff_to_quickfix
@ 2019-12-21 11:38 Beat Bolli
  2019-12-21 11:38 ` [PATCH 2/2] contrib/git-jump: add mode commit Beat Bolli
  0 siblings, 1 reply; 5+ messages in thread
From: Beat Bolli @ 2019-12-21 11:38 UTC (permalink / raw)
  To: Jeff King; +Cc: git, Beat Bolli

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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-12-22 12:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-21 11:38 [PATCH 1/2] contrib/git-jump: extract function diff_to_quickfix Beat Bolli
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).