git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] git-jump: ignore (custom) prefix in diff mode

From
Jeff King <peff@peff.net>
Date
Sep 17, 2012, 17:39 UTC
Message-ID
<20120917173945.GA22000@sigill.intra.peff.net>
In-Reply-To
<7vtxuxw7bf.fsf@alter.siamese.dyndns.org>
On Sun, Sep 16, 2012 at 10:24:04PM -0700, Junio C Hamano wrote:
Show 30 quoted lines
> Mischa POSLAWSKY <git@shiar.nl> writes:
> 
> > 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;
> 
> Makes sense to me.  Peff?
Yes, looks obviously correct. Thanks.
Acked-by: Jeff King <peff@peff.net>
-Peff
Previous: Junio C HamanoNext: Junio C Hamano
Message 9 of 10 in “git-jump: ignore (custom) prefix in diff mode”
  1. git-jump: ignore (custom) prefix in diff modeMischa POSLAWSKY, Sep 17, 2012
  2. Mischa POSLAWSKYSep 17, 2012
  3. Junio C HamanoSep 17, 2012
  4. Mischa POSLAWSKYSep 18, 2012
  5. Junio C HamanoSep 18, 2012
  6. Bert WesargSep 18, 2012
  7. perryh@pluto.rain.comSep 17, 2012
  8. Junio C HamanoSep 17, 2012
  9. Jeff KingSep 17, 2012
  10. Junio C HamanoSep 17, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.