Subject: Re: [Bug] git diff assumes executable permissions change is always 0755

From: Denton Liu <[email-masked]>
Date: Fri, 22 Nov 2019 12:11:49 -0800

Hi Wes,

On Fri, Nov 22, 2019 at 02:47:02PM -0500, Wes Hurd wrote:
> git 2.24.0
> macOS 10.14.6
> 
> To reproduce:
>  - Start a file, commit in git
>  - chmod 0744 file.txt
>  - git diff
>  - ls -l file.txt
> 
> git diff reports :
> old mode 100644
> new mode 100755
> 
> expected:
> git lists actual permissions of file
> new mode 100744
> File's permissions are 0744 (-rwxr--r--)
> 
> Thanks,

This is expected behaviour. Git only tracks the user executable bit and
extends it to group and other. See here[1] for more details.

Would setting your umask help in any way?

Thanks,

Denton

[1]: https://git-scm.com/docs/user-manual#tree-object