{"thread":{"id":"28103","subject":"diff --stat when chmoding binary files","startedAt":"2011-08-15T08:50:49Z","lastAt":"2011-08-15T08:50:49Z","messageCount":1,"participants":["Martin Mares"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"173529","messageId":"mj+md-20110815.084527.10358.albireo@ucw.cz","threadId":"28103","inReplyTo":null,"subject":"diff --stat when chmoding binary files","fromName":"Martin Mares","fromEmail":"mj@ucw.cz","sentAt":"2011-08-15T08:50:49Z","receivedAt":"2011-08-15T08:50:49Z","isPatch":false,"sender":{"key":"mj@ucw.cz","avatar":null},"body":"Hello, world!\\n\n\nI have discovered somewhat surprising behavior of `git diff --stat'\non files, which are not modified except for their executable bits.\nWhen the file is binary, it is listed in the diffstat, otherwise\nit is not.\n\nFor example:\n\n| mj@albireo:/tmp$ mkdir gt\n| mj@albireo:/tmp$ cd gt\n| mj@albireo:/tmp/gt$ git init\n| Initialized empty Git repository in /tmp/gt/.git/\n| mj@albireo:/tmp/gt$ echo abcdef >a\n| mj@albireo:/tmp/gt$ dd if=/dev/zero of=b bs=1024 count=1\n| 1+0 records in\n| 1+0 records out\n| 1024 bytes (1.0 kB) copied, 7.3243e-05 s, 14.0 MB/s\n| mj@albireo:/tmp/gt$ git add *\n| mj@albireo:/tmp/gt$ git commit -m 'adding'\n| [master (root-commit) 295d5f9] adding\n|  2 files changed, 1 insertions(+), 0 deletions(-)\n|  create mode 100644 a\n|  create mode 100644 b\n| mj@albireo:/tmp/gt$ chmod 755 *\n| mj@albireo:/tmp/gt$ git add *\n| mj@albireo:/tmp/gt$ git commit -m 'chmoding'\n| [master 61c251b] chmoding\n|  1 files changed, 0 insertions(+), 0 deletions(-)\n|  mode change 100644 => 100755 a\n|  mode change 100644 => 100755 b\n| mj@albireo:/tmp/gt$ git diff HEAD^\n| diff --git a/a b/a\n| old mode 100644\n| new mode 100755\n| diff --git a/b b/b\n| old mode 100644\n| new mode 100755\n| mj@albireo:/tmp/gt$ git diff --stat HEAD^\n|  b |  Bin 1024 -> 1024 bytes\n|  1 files changed, 0 insertions(+), 0 deletions(-)\n\nThis happens in git-1.7.6 and in several older versions as well.\n\nAm I missing something or is it a bug?\n\n\t\t\t\tHave a nice fortnight\n-- \nMartin `MJ' Mares                          <mj@ucw.cz>   http://mj.ucw.cz/\nFaculty of Math and Physics, Charles University, Prague, Czech Rep., Earth\nQ: Who invented the first airplane that did not fly?  A: The Wrong Brothers.\n"}]}