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

Bug report: Same path printed twice when comparing two directories outside repo

From
LLexis <zuiqxejp@runbox.com>
Date
Aug 15, 2020, 10:36 UTC
Message-ID
<3f6ada7b-5de9-e69f-3b45-3b529862183e@runbox.com>

# Bug report: Same path printed twice when comparing two directories outside repo

## Repro steps

```sh #!/bin/bash cd $(mktemp -d) mkdir dir0 mkdir dir1 touch dir1/test git diff --no-index dir0 dir1 ```

## Expected output
diff --git a/dir0/test b/dir1/test

new file mode 100644

index 0000000..e69de29


## Actual output

diff --git a/dir1/test b/dir1/test

new file mode 100644

index 0000000..e69de29


## Difference between expected and actual output

The first output line shows the path to the compared file in the second
directory twice in the actual output. I expected it to print one path
for each directory.

[System Info]
git Version:
git version 2.28.0.297.g1956fa8f8d
cpu: x86_64
built from commit: 1956fa8f8d7168157346f0cbc0f1f9dd1fca787a
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
uname: Linux 5.7.14-200.fc32.x86_64 #1 SMP Fri Aug 7 23:16:37 UTC 2020
x86_64
Compiler Info: gnuc: 10.2
libc Info: glibc: 2.31
$SHELL (typically, interactive shell): /usr/bin/zsh
Message 1 of 1 in “Bug report: Same path printed twice when comparing two directories outside repo”
  1. LexisAug 15, 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.