public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* git and filemodes
@ 2021-12-27 22:45 Jim Garrison
       [not found] ` <CA+kUOamusZbWfriVWY2++EDN_E_bJR=o+WCTP3WK4CjMxjWOZg@mail.gmail.com>
  0 siblings, 1 reply; 2+ messages in thread
From: Jim Garrison @ 2021-12-27 22:45 UTC (permalink / raw)
  To: cygwin

Win 10 20H2 with latest Cygwin

$ cygcheck -c cygwin git
Cygwin Package Information
Package              Version        Status
cygwin               3.3.3-1        OK
git                  2.34.1-1       OK


$ git diff .gitignore
warning: LF will be replaced by CRLF in .gitignore.
The file will have its original line endings in your working directory
diff --git a/.gitignore b/.gitignore
old mode 100644
new mode 100755

But

$ ls -l .gitignore
-rwxrwx---+ 1 Administrators None 84 Dec 15 16:30 .gitignore

So it appears the actual file is mode 0770, not 0755 as git is claiming.

Am I misinterpreting something here?
If not, why does git think the mode is 0755?

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

* Re: git and filemodes
       [not found] ` <CA+kUOamusZbWfriVWY2++EDN_E_bJR=o+WCTP3WK4CjMxjWOZg@mail.gmail.com>
@ 2021-12-27 23:17   ` Jim Garrison
  0 siblings, 0 replies; 2+ messages in thread
From: Jim Garrison @ 2021-12-27 23:17 UTC (permalink / raw)
  To: Adam Dinwoodie, cygwin

On 12/27/2021 3:13 PM, Adam Dinwoodie wrote:
[snip]
> This is normal Git behaviour: it doesn't record detailed file
> permissions, only presence or absence of an executable bit. It only
> ever shows  file permissions as 644 (meaning "not executable") or 755
> (meaning "executable").
> 
> Specifically, the committed version of your .gitignore file is not
> executable, but the version in your current working copy is
> executable. This is a common side-effect of checking the repository
> out using Cygwin's Git, then accessing the repository with native
> Windows programs, which includes Git for Windows. Cygwin emulates the
> *nix approach of not setting the executable bit unless it's necessary,
> whereas native Windows programs almost always set the executable bit
> on any file they touch in common with normal Windows application
> practice.
> 
> If this behaviour is undesirable for you, I'd recommend either
> sticking to using Cygwin editors, or running `git config core.fileMode
> false` to instruct Git to ignore the executable bit on the filesystem.

Thanks for the detailed explanation, that makes perfect sense.

-- 
Jim Garrison
jhg@acm.org

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

end of thread, other threads:[~2021-12-27 23:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-27 22:45 git and filemodes Jim Garrison
     [not found] ` <CA+kUOamusZbWfriVWY2++EDN_E_bJR=o+WCTP3WK4CjMxjWOZg@mail.gmail.com>
2021-12-27 23:17   ` Jim Garrison

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