git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mischa POSLAWSKY <git@shiar.nl>
To: git@vger.kernel.org
Cc: Jeff King <peff@peff.net>
Subject: [PATCH] git-jump: ignore (custom) prefix in diff mode
Date: Mon, 17 Sep 2012 03:21:55 +0200	[thread overview]
Message-ID: <1347844915-4130-1-git-send-email-git@shiar.nl> (raw)

Matching the default file prefix b/ does not yield any results if config
option diff.noprefix or diff.mnemonicprefix is enabled.

Signed-off-by: Mischa POSLAWSKY <git@shiar.nl>
---
Very useful script otherwise; thanks.

 contrib/git-jump/git-jump | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git contrib/git-jump/git-jump contrib/git-jump/git-jump
index a33674e..dc90cd6 100755
--- contrib/git-jump/git-jump
+++ contrib/git-jump/git-jump
@@ -21,9 +21,9 @@ open_editor() {
 }
 
 mode_diff() {
-	git diff --relative "$@" |
+	git diff --no-prefix --relative "$@" |
 	perl -ne '
-	if (m{^\+\+\+ b/(.*)}) { $file = $1; next }
+	if (m{^\+\+\+ (.*)}) { $file = $1; next }
 	defined($file) or next;
 	if (m/^@@ .*\+(\d+)/) { $line = $1; next }
 	defined($line) or next;
-- 
1.7.12.165.g8cb9d9c

             reply	other threads:[~2012-09-17  1:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-17  1:21 Mischa POSLAWSKY [this message]
2012-09-17  3:01 ` [PATCH] git-jump: ignore (custom) prefix in diff mode Mischa POSLAWSKY
2012-09-17  5:22   ` Junio C Hamano
2012-09-18  2:52     ` Mischa POSLAWSKY
2012-09-18  3:57       ` Junio C Hamano
2012-09-18  9:00       ` Bert Wesarg
2012-09-17  6:03   ` perryh
2012-09-17  5:24 ` Junio C Hamano
2012-09-17 17:39   ` Jeff King
2012-09-17 19:48     ` Junio C Hamano

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=1347844915-4130-1-git-send-email-git@shiar.nl \
    --to=git@shiar.nl \
    --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 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).