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

Broken Git-diff on master

From
Son Luong Ngoc <sluongng@gmail.com>
Date
Mar 18, 2020, 20:41 UTC
Message-ID
<20BFEDB4-738A-4DD7-9316-8DE73999C633@gmail.com>
Hey folks,
I am testing out the latest changes in master be8661a3286c67a5d4088f4226cbd7f8b76544b0 and observe the following
Show 5 quoted lines
> mkdir test
> cd test
> echo a > a
> echo b > b
> git diff a b | cat
diff --git a/a b/b
index 7898192..6178079 100644
--- a/a
+++ b/b
@@ -1 +1 @@
-a
+b
> git init
> git diff a b | cat
> GIT_TRACE2_PERF=1 git diff a b | cat
21:38:36.615653 common-main.c:48             | d0 | main                     | version      |     |           |           |              | 2.26.0.rc2.27.gbe8661a328
21:38:36.616258 common-main.c:49             | d0 | main                     | start        |     |  0.004075 |           |              | git diff a b
21:38:36.616307 git.c:440                    | d0 | main                     | cmd_name     |     |           |           |              | diff (diff)
21:38:36.616696 repository.c:130             | d0 | main                     | def_repo     | r1  |           |           |              | worktree:/Users/sluongngoc/work/some-dir/test
21:38:36.617589 read-cache.c:2303            | d0 | main                     | region_enter | r1  |  0.005408 |           | index        | label:do_read_index .git/index
21:38:36.617615 read-cache.c:2308            | d0 | main                     | region_leave | r1  |  0.005435 |  0.000027 | index        | label:do_read_index .git/index
21:38:36.617656 git.c:674                    | d0 | main                     | exit         |     |  0.005476 |           |              | code:0
21:38:36.617668 trace2/tr2_tgt_perf.c:213    | d0 | main                     | atexit       |     |  0.005489 |           |              | code:0

> git version
git version 2.26.0.rc2.27.gbe8661a328

I think git-diff is broken. Hope that this get address before 2.26.0 come out.

Cheers,
Son Luong.
Next: Son Luong Ngoc
Message 1 of 2 in “Broken Git-diff on master”
  1. Son Luong NgocMar 18, 2020
  2. Son Luong NgocMar 18, 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.