git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [Bug] git diff assumes executable permissions change is always 0755
@ 2019-11-22 19:47 Wes Hurd
  2019-11-22 20:08 ` Elijah Newren
  2019-11-22 20:11 ` Denton Liu
  0 siblings, 2 replies; 3+ messages in thread
From: Wes Hurd @ 2019-11-22 19:47 UTC (permalink / raw)
  To: git

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,

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Bug] git diff assumes executable permissions change is always 0755
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Elijah Newren @ 2019-11-22 20:08 UTC (permalink / raw)
  To: Wes Hurd; +Cc: Git Mailing List

On Fri, Nov 22, 2019 at 11:50 AM Wes Hurd <13hurdw@gmail.com> 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 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.)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Bug] git diff assumes executable permissions change is always 0755
  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
  1 sibling, 0 replies; 3+ messages in thread
From: Denton Liu @ 2019-11-22 20:11 UTC (permalink / raw)
  To: Wes Hurd; +Cc: git

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-11-22 20:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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

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).