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

Re: git diff --name-status does not always list changed files

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 28, 2008, 19:33 UTC
Message-ID
<7vablkkhac.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<fq6hhi$cub$1@ger.gmane.org>
Sebastian Schuberth <sschuberth@gmail.com> writes:
Show 13 quoted lines
> ...
> so I decided to fix these files in my clean working tree with
>
> for i in `find . -iname "*.c" -o -iname "*.cc" -o -iname "*.cpp" -o
> -iname "*.h" -o -iname "*.hpp"`; do
>     echo $i
>     echo wq | ed $i > /dev/null 2>&1
> done
>
> Afterwards, I wanted so see a list of files that were actually
> affected, but to my wonderment "git diff --name-status" did not list
> any files, although both "git diff" and "gitk" showed the diffs
> correctly.
Doesn't reproduce for me.
        $ rm -fr /var/tmp/j && mkdir -p /var/tmp/j && cd /var/tmp/j
        $ git init
        Initialized empty Git repository in .git/
        $ echo -n hello > world
        $ git add world
        $ od -c world
        0000000   h   e   l   l   o
        0000005
        $ echo wq | ed world
        Newline appended
        6
        6
        $ od -c world
        0000000   h   e   l   l   o  \n
        0000006
        $ git diff --name-status
        M	world
        $ git diff --raw
        :100644 100644 b6fc4c6... 0000000... M	world
        $ exit
Previous: Sebastian SchuberthNext: Sebastian Schuberth
Message 2 of 6 in “git diff --name-status does not always list changed files”
  1. Sebastian SchuberthFeb 28, 2008
  2. Junio C HamanoFeb 28, 2008
  3. Sebastian SchuberthFeb 28, 2008
  4. Junio C HamanoFeb 28, 2008
  5. Sebastian SchuberthFeb 28, 2008
  6. Junio C HamanoFeb 28, 2008

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.