git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Denton Liu <liu.denton@gmail.com>
To: Wes Hurd <13hurdw@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [Bug] git diff assumes executable permissions change is always 0755
Date: Fri, 22 Nov 2019 12:11:49 -0800	[thread overview]
Message-ID: <20191122201149.GA70732@generichostname> (raw)
In-Reply-To: <CAOAGZwFScnS=FSfe9WiJ2h5W1-NCtxU4HM4FUH9LwtcCRuimcg@mail.gmail.com>

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

      parent reply	other threads:[~2019-11-22 20:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-22 19:47 [Bug] git diff assumes executable permissions change is always 0755 Wes Hurd
2019-11-22 20:08 ` Elijah Newren
2019-11-22 20:11 ` Denton Liu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191122201149.GA70732@generichostname \
    --to=liu.denton@gmail.com \
    --cc=13hurdw@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).