All of lore.kernel.org
 help / color / mirror / Atom feed
* ignoring file modes completely
@ 2011-02-05 15:24 Rafael Kitover
  2011-02-05 16:03 ` Jared Hance
  0 siblings, 1 reply; 10+ messages in thread
From: Rafael Kitover @ 2011-02-05 15:24 UTC (permalink / raw)
  To: git

Hello,

I found the core.filemode option, which ignores executable bits, but I 
need an option to ignore all mode differences, and such an option does 
not seem to exist.

The reason for this is that I'm trying to use msysGit with Cygwin git, 
sometimes to work with an msysGit clone in cygwin or to work with a 
Cygwin git clone in msysGit. For example, I would like to use "git 
cpan-init" under Cygwin, then use msysGit to work with the repository, 
this is currently impossible.

Here is "git status" on a repo made with Cygwin git under msysGit:

$ git status
# On branch master
# Changed but not updated:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working 
directory)
#
#       modified:   Makefile.PL
#       modified:   t/02ads.t
#       modified:   t/02cxn.t
#       modified:   t/04os.t
...
...

Every file is modified because the modes do not match :(

Would it be possible to add some sort of option to ignore all file mode 
changes?

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

* Re: ignoring file modes completely
  2011-02-05 15:24 ignoring file modes completely Rafael Kitover
@ 2011-02-05 16:03 ` Jared Hance
  2011-02-05 16:09   ` Rafael Kitover
  0 siblings, 1 reply; 10+ messages in thread
From: Jared Hance @ 2011-02-05 16:03 UTC (permalink / raw)
  To: rkitover; +Cc: git

On Sat, 2011-02-05 at 10:24 -0500, Rafael Kitover wrote: 
> Hello,
> 
> I found the core.filemode option, which ignores executable bits, but I 
> need an option to ignore all mode differences, and such an option does 
> not seem to exist.

The only mode tracked by Git is the executable bit, so this shouldn't
even be an issue. Are you sure the executable bit isn't the problem?

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

* Re: ignoring file modes completely
  2011-02-05 16:03 ` Jared Hance
@ 2011-02-05 16:09   ` Rafael Kitover
  2011-02-05 16:58     ` Andreas Ericsson
  0 siblings, 1 reply; 10+ messages in thread
From: Rafael Kitover @ 2011-02-05 16:09 UTC (permalink / raw)
  To: git

On 2/5/2011 11:03 AM, Jared Hance wrote:
> On Sat, 2011-02-05 at 10:24 -0500, Rafael Kitover wrote:
>> Hello,
>>
>> I found the core.filemode option, which ignores executable bits, but I
>> need an option to ignore all mode differences, and such an option does
>> not seem to exist.
>
> The only mode tracked by Git is the executable bit, so this shouldn't
> even be an issue. Are you sure the executable bit isn't the problem?
>
$ git config --global core.filemode
false

Output of "git diff HEAD" :

diff --git a/Makefile.PL b/Makefile.PL
old mode 100755
new mode 100644
diff --git a/t/02ads.t b/t/02ads.t
old mode 100755
new mode 100644
diff --git a/t/02cxn.t b/t/02cxn.t
old mode 100755
new mode 100644
diff --git a/t/04os.t b/t/04os.t
old mode 100755
new mode 100644
...
...

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

* Re: ignoring file modes completely
  2011-02-05 16:09   ` Rafael Kitover
@ 2011-02-05 16:58     ` Andreas Ericsson
  2011-02-05 19:28       ` Rafael Kitover
  0 siblings, 1 reply; 10+ messages in thread
From: Andreas Ericsson @ 2011-02-05 16:58 UTC (permalink / raw)
  To: rkitover; +Cc: git

On 02/05/2011 05:09 PM, Rafael Kitover wrote:
> On 2/5/2011 11:03 AM, Jared Hance wrote:
>> On Sat, 2011-02-05 at 10:24 -0500, Rafael Kitover wrote:
>>> Hello,
>>>
>>> I found the core.filemode option, which ignores executable bits, but I
>>> need an option to ignore all mode differences, and such an option does
>>> not seem to exist.
>>
>> The only mode tracked by Git is the executable bit, so this shouldn't
>> even be an issue. Are you sure the executable bit isn't the problem?
>>
> $ git config --global core.filemode
> false
> 
> Output of "git diff HEAD" :
> 
> diff --git a/Makefile.PL b/Makefile.PL
> old mode 100755
> new mode 100644
> diff --git a/t/02ads.t b/t/02ads.t
> old mode 100755
> new mode 100644
> diff --git a/t/02cxn.t b/t/02cxn.t
> old mode 100755
> new mode 100644
> diff --git a/t/04os.t b/t/04os.t
> old mode 100755
> new mode 100644

Those are all executable bit diffs.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

Considering the successes of the wars on alcohol, poverty, drugs and
terror, I think we should give some serious thought to declaring war
on peace.

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

* Re: ignoring file modes completely
  2011-02-05 16:58     ` Andreas Ericsson
@ 2011-02-05 19:28       ` Rafael Kitover
  2011-02-06 13:14         ` Michael J Gruber
  0 siblings, 1 reply; 10+ messages in thread
From: Rafael Kitover @ 2011-02-05 19:28 UTC (permalink / raw)
  Cc: git

On 2/5/2011 11:58 AM, Andreas Ericsson wrote:
> On 02/05/2011 05:09 PM, Rafael Kitover wrote:
>> On 2/5/2011 11:03 AM, Jared Hance wrote:
>>> On Sat, 2011-02-05 at 10:24 -0500, Rafael Kitover wrote:
>>>> Hello,
>>>>
>>>> I found the core.filemode option, which ignores executable bits, but I
>>>> need an option to ignore all mode differences, and such an option does
>>>> not seem to exist.
>>>
>>> The only mode tracked by Git is the executable bit, so this shouldn't
>>> even be an issue. Are you sure the executable bit isn't the problem?
>>>
>> $ git config --global core.filemode
>> false
>>
>> Output of "git diff HEAD" :
>>
>> diff --git a/Makefile.PL b/Makefile.PL
>> old mode 100755
>> new mode 100644
>> diff --git a/t/02ads.t b/t/02ads.t
>> old mode 100755
>> new mode 100644
>> diff --git a/t/02cxn.t b/t/02cxn.t
>> old mode 100755
>> new mode 100644
>> diff --git a/t/04os.t b/t/04os.t
>> old mode 100755
>> new mode 100644
>
> Those are all executable bit diffs.
>

Ok, but I have core.filemode set to "false" as I showed, why does this 
happen then?

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

* Re: ignoring file modes completely
  2011-02-05 19:28       ` Rafael Kitover
@ 2011-02-06 13:14         ` Michael J Gruber
  2011-02-06 15:53           ` Rafael Kitover
  0 siblings, 1 reply; 10+ messages in thread
From: Michael J Gruber @ 2011-02-06 13:14 UTC (permalink / raw)
  To: rkitover; +Cc: git, Andreas Ericsson, jaredhance

Rafael Kitover venit, vidit, dixit 05.02.2011 20:28:
> On 2/5/2011 11:58 AM, Andreas Ericsson wrote:
>> On 02/05/2011 05:09 PM, Rafael Kitover wrote:
>>> On 2/5/2011 11:03 AM, Jared Hance wrote:
>>>> On Sat, 2011-02-05 at 10:24 -0500, Rafael Kitover wrote:
>>>>> Hello,
>>>>>
>>>>> I found the core.filemode option, which ignores executable bits, but I
>>>>> need an option to ignore all mode differences, and such an option does
>>>>> not seem to exist.
>>>>
>>>> The only mode tracked by Git is the executable bit, so this shouldn't
>>>> even be an issue. Are you sure the executable bit isn't the problem?
>>>>
>>> $ git config --global core.filemode
>>> false
>>>
>>> Output of "git diff HEAD" :
>>>
>>> diff --git a/Makefile.PL b/Makefile.PL
>>> old mode 100755
>>> new mode 100644
>>> diff --git a/t/02ads.t b/t/02ads.t
>>> old mode 100755
>>> new mode 100644
>>> diff --git a/t/02cxn.t b/t/02cxn.t
>>> old mode 100755
>>> new mode 100644
>>> diff --git a/t/04os.t b/t/04os.t
>>> old mode 100755
>>> new mode 100644
>>
>> Those are all executable bit diffs.
>>
> 
> Ok, but I have core.filemode set to "false" as I showed, why does this 
> happen then?

I can't confirm this on linux with current git. What are your versions?
Do you have a minimal example (starting from git init)?

Michael

BTW: Leaving out helpful folks from cc does not help... I should not
have to re-add them by hand.

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

* Re: ignoring file modes completely
  2011-02-06 13:14         ` Michael J Gruber
@ 2011-02-06 15:53           ` Rafael Kitover
  2011-02-06 16:14             ` Rafael Kitover
  0 siblings, 1 reply; 10+ messages in thread
From: Rafael Kitover @ 2011-02-06 15:53 UTC (permalink / raw)
  To: git

On 2/6/2011 8:14 AM, Michael J Gruber wrote:
> Rafael Kitover venit, vidit, dixit 05.02.2011 20:28:
>> On 2/5/2011 11:58 AM, Andreas Ericsson wrote:
>>> On 02/05/2011 05:09 PM, Rafael Kitover wrote:
>>>> On 2/5/2011 11:03 AM, Jared Hance wrote:
>>>>> On Sat, 2011-02-05 at 10:24 -0500, Rafael Kitover wrote:
>>>>>> Hello,
>>>>>>
>>>>>> I found the core.filemode option, which ignores executable bits, but I
>>>>>> need an option to ignore all mode differences, and such an option does
>>>>>> not seem to exist.
>>>>>
>>>>> The only mode tracked by Git is the executable bit, so this shouldn't
>>>>> even be an issue. Are you sure the executable bit isn't the problem?
>>>>>
>>>> $ git config --global core.filemode
>>>> false
>>>>
>>>> Output of "git diff HEAD" :
>>>>
>>>> diff --git a/Makefile.PL b/Makefile.PL
>>>> old mode 100755
>>>> new mode 100644
>>>> diff --git a/t/02ads.t b/t/02ads.t
>>>> old mode 100755
>>>> new mode 100644
>>>> diff --git a/t/02cxn.t b/t/02cxn.t
>>>> old mode 100755
>>>> new mode 100644
>>>> diff --git a/t/04os.t b/t/04os.t
>>>> old mode 100755
>>>> new mode 100644
>>>
>>> Those are all executable bit diffs.
>>>
>>
>> Ok, but I have core.filemode set to "false" as I showed, why does this
>> happen then?
>
> I can't confirm this on linux with current git. What are your versions?
> Do you have a minimal example (starting from git init)?

This is msysGit:

$ git --version
git version 1.7.3.1

I can't replicate this with just "git init" and a file, it seems to 
happen when I use "git cpan-init" in Cygwin then look at the repo in 
msysGit.

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

* Re: ignoring file modes completely
  2011-02-06 15:53           ` Rafael Kitover
@ 2011-02-06 16:14             ` Rafael Kitover
  2011-02-06 18:10               ` Dmitry Potapov
  0 siblings, 1 reply; 10+ messages in thread
From: Rafael Kitover @ 2011-02-06 16:14 UTC (permalink / raw)
  To: git

On 2/6/2011 10:53 AM, Rafael Kitover wrote:
> On 2/6/2011 8:14 AM, Michael J Gruber wrote:
>> Rafael Kitover venit, vidit, dixit 05.02.2011 20:28:
>>> On 2/5/2011 11:58 AM, Andreas Ericsson wrote:
>>>> On 02/05/2011 05:09 PM, Rafael Kitover wrote:
>>>>> On 2/5/2011 11:03 AM, Jared Hance wrote:
>>>>>> On Sat, 2011-02-05 at 10:24 -0500, Rafael Kitover wrote:
>>>>>>> Hello,
>>>>>>>
>>>>>>> I found the core.filemode option, which ignores executable bits,
>>>>>>> but I
>>>>>>> need an option to ignore all mode differences, and such an option
>>>>>>> does
>>>>>>> not seem to exist.
>>>>>>
>>>>>> The only mode tracked by Git is the executable bit, so this shouldn't
>>>>>> even be an issue. Are you sure the executable bit isn't the problem?
>>>>>>
>>>>> $ git config --global core.filemode
>>>>> false
>>>>>
>>>>> Output of "git diff HEAD" :
>>>>>
>>>>> diff --git a/Makefile.PL b/Makefile.PL
>>>>> old mode 100755
>>>>> new mode 100644
>>>>> diff --git a/t/02ads.t b/t/02ads.t
>>>>> old mode 100755
>>>>> new mode 100644
>>>>> diff --git a/t/02cxn.t b/t/02cxn.t
>>>>> old mode 100755
>>>>> new mode 100644
>>>>> diff --git a/t/04os.t b/t/04os.t
>>>>> old mode 100755
>>>>> new mode 100644
>>>>
>>>> Those are all executable bit diffs.
>>>>
>>>
>>> Ok, but I have core.filemode set to "false" as I showed, why does this
>>> happen then?
>>
>> I can't confirm this on linux with current git. What are your versions?
>> Do you have a minimal example (starting from git init)?
>
> This is msysGit:
>
> $ git --version
> git version 1.7.3.1
>
> I can't replicate this with just "git init" and a file, it seems to
> happen when I use "git cpan-init" in Cygwin then look at the repo in
> msysGit.

Actually, I can replicate this in Cygwin git:

$ git --version
git version 1.7.3.3

$ cd ~/src
$ mkdir test-repo
$ cd test-repo
$ git init
$ touch README
$ git add README
$ git commit -a -m'test commit'
$ git diff HEAD
$ chmod +x README
$ git diff HEAD
diff --git a/README b/README
old mode 100644
new mode 100755
$ git config --global core.filemode
false

The way the executable bit works seems to be different between Cygwin 
and msys, but in either case core.filemode seems to not be working properly.

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

* Re: ignoring file modes completely
  2011-02-06 16:14             ` Rafael Kitover
@ 2011-02-06 18:10               ` Dmitry Potapov
  2011-02-06 20:29                 ` Rafael Kitover
  0 siblings, 1 reply; 10+ messages in thread
From: Dmitry Potapov @ 2011-02-06 18:10 UTC (permalink / raw)
  To: rkitover; +Cc: git

On Sun, Feb 06, 2011 at 11:14:30AM -0500, Rafael Kitover wrote:
> $ git diff HEAD
> diff --git a/README b/README
> old mode 100644
> new mode 100755
> $ git config --global core.filemode
> false

This is because core.filemode is set in the local configuration:
$ git config core.filemode
true

Git automatically detects if chmod(2) is supported on the current file
system and sets core.filemode to the corresponding value. Because cygwin
emulates chmod(), git sets core.filemode to true.

Dmitry

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

* Re: ignoring file modes completely
  2011-02-06 18:10               ` Dmitry Potapov
@ 2011-02-06 20:29                 ` Rafael Kitover
  0 siblings, 0 replies; 10+ messages in thread
From: Rafael Kitover @ 2011-02-06 20:29 UTC (permalink / raw)
  To: git

On 2/6/2011 1:10 PM, Dmitry Potapov wrote:
> On Sun, Feb 06, 2011 at 11:14:30AM -0500, Rafael Kitover wrote:
>> $ git diff HEAD
>> diff --git a/README b/README
>> old mode 100644
>> new mode 100755
>> $ git config --global core.filemode
>> false
>
> This is because core.filemode is set in the local configuration:
> $ git config core.filemode
> true
>
> Git automatically detects if chmod(2) is supported on the current file
> system and sets core.filemode to the corresponding value. Because cygwin
> emulates chmod(), git sets core.filemode to true.

That was it! Thank you very much. I can now use msysGit and Cygwin git 
together, very cool.

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

end of thread, other threads:[~2011-02-06 20:30 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-05 15:24 ignoring file modes completely Rafael Kitover
2011-02-05 16:03 ` Jared Hance
2011-02-05 16:09   ` Rafael Kitover
2011-02-05 16:58     ` Andreas Ericsson
2011-02-05 19:28       ` Rafael Kitover
2011-02-06 13:14         ` Michael J Gruber
2011-02-06 15:53           ` Rafael Kitover
2011-02-06 16:14             ` Rafael Kitover
2011-02-06 18:10               ` Dmitry Potapov
2011-02-06 20:29                 ` Rafael Kitover

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.