Re: [Bug] git diff assumes executable permissions change is always 0755
- From
Elijah Newren <newren@gmail.com>
- Date
- Nov 22, 2019, 20:08 UTC
- Message-ID
- <CABPp-BHb7z4PnyWu9YOiJv8jLEQnvmAHQmFq2=d=m1njtdDwug@mail.gmail.com>
- In-Reply-To
- <CAOAGZwFScnS=FSfe9WiJ2h5W1-NCtxU4HM4FUH9LwtcCRuimcg@mail.gmail.com>
On Fri, Nov 22, 2019 at 11:50 AM Wes Hurd <13hurdw@gmail.com> wrote:
Show 18 quoted lines
> > 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 for the report, but this isn't a bug. See the final paragraph of https://git-scm.com/docs/user-manual#tree-object. (Said another way, git doesn't track full permisions of files nor ACLs nor creation/modification/access times, or other filesystem-specific data. It's reporting to you the data as recorded in git which for normal files will be either 100644 or 100755.)