{"thread":{"id":"52316","subject":"[Bug] git diff assumes executable permissions change is always 0755","startedAt":"2019-11-22T19:47:16Z","lastAt":"2019-11-22T20:11:56Z","messageCount":3,"participants":["Wes Hurd","Elijah Newren","Denton Liu"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"386862","messageId":"CAOAGZwFScnS=FSfe9WiJ2h5W1-NCtxU4HM4FUH9LwtcCRuimcg@mail.gmail.com","threadId":"52316","inReplyTo":null,"subject":"[Bug] git diff assumes executable permissions change is always 0755","fromName":"Wes Hurd","fromEmail":"13hurdw@gmail.com","sentAt":"2019-11-22T19:47:02Z","receivedAt":"2019-11-22T19:47:16Z","isPatch":false,"sender":{"key":"13hurdw@gmail.com","avatar":null},"body":"git 2.24.0\nmacOS 10.14.6\n\nTo reproduce:\n - Start a file, commit in git\n - chmod 0744 file.txt\n - git diff\n - ls -l file.txt\n\ngit diff reports :\nold mode 100644\nnew mode 100755\n\nexpected:\ngit lists actual permissions of file\nnew mode 100744\nFile's permissions are 0744 (-rwxr--r--)\n\nThanks,\n"},{"id":"386863","messageId":"CABPp-BHb7z4PnyWu9YOiJv8jLEQnvmAHQmFq2=d=m1njtdDwug@mail.gmail.com","threadId":"52316","inReplyTo":"CAOAGZwFScnS=FSfe9WiJ2h5W1-NCtxU4HM4FUH9LwtcCRuimcg@mail.gmail.com","subject":"Re: [Bug] git diff assumes executable permissions change is always 0755","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2019-11-22T20:08:47Z","receivedAt":"2019-11-22T20:09:02Z","isPatch":false,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"On Fri, Nov 22, 2019 at 11:50 AM Wes Hurd <13hurdw@gmail.com> wrote:\n>\n> git 2.24.0\n> macOS 10.14.6\n>\n> To reproduce:\n>  - Start a file, commit in git\n>  - chmod 0744 file.txt\n>  - git diff\n>  - ls -l file.txt\n>\n> git diff reports :\n> old mode 100644\n> new mode 100755\n>\n> expected:\n> git lists actual permissions of file\n> new mode 100744\n> File's permissions are 0744 (-rwxr--r--)\n\nThanks for the report, but this isn't a bug.  See the final paragraph\nof https://git-scm.com/docs/user-manual#tree-object.  (Said another\nway, git doesn't track full permisions of files nor ACLs nor\ncreation/modification/access times, or other filesystem-specific data.\nIt's reporting to you the data as recorded in git which for normal\nfiles will be either 100644 or 100755.)\n"},{"id":"386864","messageId":"20191122201149.GA70732@generichostname","threadId":"52316","inReplyTo":"CAOAGZwFScnS=FSfe9WiJ2h5W1-NCtxU4HM4FUH9LwtcCRuimcg@mail.gmail.com","subject":"Re: [Bug] git diff assumes executable permissions change is always 0755","fromName":"Denton Liu","fromEmail":"liu.denton@gmail.com","sentAt":"2019-11-22T20:11:49Z","receivedAt":"2019-11-22T20:11:56Z","isPatch":false,"sender":{"key":"liu.denton@gmail.com","avatar":"https://avatars.githubusercontent.com/u/9620836?v=4"},"body":"Hi Wes,\n\nOn Fri, Nov 22, 2019 at 02:47:02PM -0500, Wes Hurd wrote:\n> git 2.24.0\n> macOS 10.14.6\n> \n> To reproduce:\n>  - Start a file, commit in git\n>  - chmod 0744 file.txt\n>  - git diff\n>  - ls -l file.txt\n> \n> git diff reports :\n> old mode 100644\n> new mode 100755\n> \n> expected:\n> git lists actual permissions of file\n> new mode 100744\n> File's permissions are 0744 (-rwxr--r--)\n> \n> Thanks,\n\nThis is expected behaviour. Git only tracks the user executable bit and\nextends it to group and other. See here[1] for more details.\n\nWould setting your umask help in any way?\n\nThanks,\n\nDenton\n\n[1]: https://git-scm.com/docs/user-manual#tree-object\n"}]}