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

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:44:18

Sebastian Schuberth [off-list ref] writes:
...
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

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

From: Sebastian Schuberth <hidden>
Date: 2016-06-15 22:44:18

Junio C Hamano wrote:
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/
Can you reproduce it if you do

$ git config core.pager "less -F"

after "git init"? The "-F" seems to be important, but I'm not sure why
using this switch causes no files to be displayed in this case.

-- 
Sebastian Schuberth
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help