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

Re: [PATCH 2/2] git-jump: ignore deleted files in diff mode

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 17, 2024, 15:03 UTC
Message-ID
<xmqqed5il3ui.fsf@gitster.g>
In-Reply-To
<ZulEwjnNQet6th8w@nand.local>
Taylor Blau <me@ttaylorr.com> writes:
Show 15 quoted lines
> On Sun, Sep 15, 2024 at 07:20:24AM -0400, Jeff King wrote:
>> diff --git a/contrib/git-jump/git-jump b/contrib/git-jump/git-jump
>> index 78e7394406..3f69675961 100755
>> --- a/contrib/git-jump/git-jump
>> +++ b/contrib/git-jump/git-jump
>> @@ -44,7 +44,7 @@ open_editor() {
>>  mode_diff() {
>>  	git diff --no-prefix --relative "$@" |
>>  	perl -ne '
>> -	if (m{^\+\+\+ (.*)}) { $file = $1; next }
>> +	if (m{^\+\+\+ (.*)}) { $file = $1 eq "/dev/null" ? undef : $1; next }
>
> I was surprised to not see you use `--diff-filter` here, but I think
> that that makes sense. You only would want to exclude deletions, since
> that would be the only time the post-image is /dev/null AFAICT.
So "--diff-filter=d" (lowercase)?
Previous: Taylor BlauNext: Jeff King
Message 7 of 10 in “a few git-jump quality-of-life fixes”
  1. 0/2 a few git-jump quality-of-life fixesJeff King, Sep 15, 2024
  2. 1/2 git-jump: always specify column 1 for diff entriesJeff King, Sep 15, 2024
  3. Martin ÅgrenSep 16, 2024
  4. 2/2 git-jump: ignore deleted files in diff modeJeff King, Sep 15, 2024
  5. Martin ÅgrenSep 16, 2024
  6. Taylor BlauSep 17, 2024
  7. Junio C HamanoSep 17, 2024
  8. Jeff KingSep 24, 2024
  9. Taylor BlauSep 24, 2024
  10. Junio C HamanoSep 25, 2024

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.