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

[PATCH 0/1] diff-highlight: highlight range-diff

From
JGJack Bates via GitGitGadget <gitgitgadget@gmail.com>
Date
Dec 29, 2019, 15:49 UTC
Message-ID
<pull.684.git.git.1577634590.gitgitgadget@gmail.com>

Piping git range-diff through diff-highlight currently has no effect, for two reasons:

 1. There are ANSI escapes before and after the @@ hunk headers (when color
    is enabled) which diff-highlight fails to match. One solution is to
    match both escapes (/^$COLOR*\@\@$COLOR* /). This patch drops the
    trailing space from the existing pattern instead.
    
    
 2. Unlike git log, git range-diff diffs are indented, which diff-highlight
    also fails to match. This patch allows hunk headers preceded by any
    amount of whitespace, and then skips past that indentation when parsing
    subsequent lines, by reusing the machinery that handles the --graph
    output.
    
    
Signed-off-by: Jack Bates jack@nottheoilrig.com [jack@nottheoilrig.com]
Jack Bates (1):
  diff-highlight: highlight range-diff
 contrib/diff-highlight/DiffHighlight.pm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
base-commit: 0a76bd7381ec0dbb7c43776eb6d1ac906bca29e6
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-684%2Fjablko%2Fpatch-1-v1
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-684/jablko/patch-1-v1
Pull-Request: https://github.com/git/git/pull/684
-- 
gitgitgadget
Next: Jack Bates via GitGitGadget
Message 1 of 3 in “diff-highlight: highlight range-diff”
  1. 0/1 diff-highlight: highlight range-diffJack Bates via GitGitGadget, Dec 29, 2019
  2. 1/1 diff-highlight: highlight range-diffJack Bates via GitGitGadget, Dec 29, 2019
  3. Jeff KingJan 28, 2020

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.