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

[Bug report] diff.noprefix config is ignored for interactive `add`

From
NBNikita Bobko <nikitabobko@gmail.com>
Date
Apr 6, 2021, 10:15 UTC
Message-ID
<CAMJzOtyzu8y5mWdKXe3MPe8ZoJs8O=me8Xuu0t77YVdAMc7Tgg@mail.gmail.com>
Steps to reproduce:
1. Run `git -c diff.noprefix=true add -p`

Expected behavior: `a/` and `b/` prefixes are not shown during interactive `add` like this: ```

diff --git foo foo
index 257cc56..1715acd 100644
--- foo
+++ foo
@@ -1 +1 @@
-foo
+bar
(1/1) Stage this hunk [y,n,q,a,d,e,?]?
```

Actual behavior:
`a/` and `b/` prefixes are shown instead. Like this:
```
diff --git a/foo b/foo
index 257cc56..1715acd 100644
--- a/foo
+++ b/foo
@@ -1 +1 @@
-foo
+bar
(1/1) Stage this hunk [y,n,q,a,d,e,?]?
```

[System Info]
git version:
git version 2.30.1
cpu: x86_64
no commit associated with this build
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
uname: Linux 5.4.98-1-lts #1 SMP Sat, 13 Feb 2021 19:22:14 +0000 x86_64
compiler info: gnuc: 10.2
libc info: glibc: 2.33
$SHELL (typically, interactive shell): /bin/zsh

[Enabled Hooks]
Next: Jeff King
Message 1 of 4 in “[Bug report] diff.noprefix config is ignored for interactive `add`”
  1. Nikita BobkoApr 6, 2021
  2. Jeff KingApr 6, 2021
  3. Junio C HamanoApr 6, 2021
  4. Jeff KingApr 6, 2021

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.