Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » Executable flags
Executable flags [message #10932] Tue, 21 July 2009 17:05 Go to next message
Dmitry Smirnov is currently offline Dmitry SmirnovFriend
Messages: 92
Registered: July 2009
Member
I see there was some bug reported related to this problem
( http://code.google.com/p/egit/issues/detail?id=3&colspec =ID%20Type%20Status%20Priority%20Component%20Owner%20Summary)

But it is unclear what is the status of it.

I'm working on Windows and use Cygwin-based git sometimes, so this problem
a little bit annoying.
I see that neither FS_Win32.java nor FS_Win32_Cygwin.java does not handle
canExecute and setExecute properly.

Meantime, I suppose there could be some ways to fix it. For FS_Win32.java
it could be some native code. FS_Win32_Cygwin.java could use 'chmod', for
example.

Dmitry
Re: Executable flags [message #10942 is a reply to message #10932] Tue, 21 July 2009 23:30 Go to previous messageGo to next message
Shawn O. Pearce is currently offline Shawn O. PearceFriend
Messages: 82
Registered: July 2009
Member
Dmitry Smirnov wrote:
> I see there was some bug reported related to this problem
> ( http://code.google.com/p/egit/issues/detail?id=3&colspec =ID%20Type%20Status%20Priority%20Component%20Owner%20Summary)
>
>
> But it is unclear what is the status of it.
>
> I'm working on Windows and use Cygwin-based git sometimes, so this
> problem a little bit annoying.
> I see that neither FS_Win32.java nor FS_Win32_Cygwin.java does not
> handle canExecute and setExecute properly.
>
> Meantime, I suppose there could be some ways to fix it. For
> FS_Win32.java it could be some native code. FS_Win32_Cygwin.java could
> use 'chmod', for example.

You are right, the FS_Win32 implementations disable the setExecute
method support, even if the JVM is a Java 6 variant with setExecute
available in the java.io.File class.

For some reason commit 1432c8b2dd[1] says the setExecute method is
useless on Win32, but I don't remember why I wrote that. IIRC it was
something about every file being executable on Windows, no matter what,
which really disagreed with Git's concept of executable, especially in a
Cygwin based repository.

As for status of this bug, nobody is working on it right now, so its
just hanging out there. :-(

[1]
http://repo.or.cz/w/jgit.git?a=commit;h=1432c8b2ddbabdd285715fbe7a0be58e36014df5
Re: Executable flags [message #10973 is a reply to message #10942] Wed, 22 July 2009 12:57 Go to previous messageGo to next message
Dmitry Smirnov is currently offline Dmitry SmirnovFriend
Messages: 92
Registered: July 2009
Member
Where can find info about "Git's concept of executable"?

I had played with some file on my machine.

Gygwin reports the following
D:\>ls -l artifacts.xml
-rwxrwxrwx 1 dsmirnov Russia_Eng 1270894 Jun 29 15:08 artifacts.xml

Windows file Properties->security shows that "Everyone" has Read&Execute
permissions (among others, including Full Control).

If I turn off executable flags with Cygwin (chmod 644), properties will
show 2 more users/groups (Domain Users and me personally). Both Domain
Users and Everyone will have only Read permission, while me having Read
and Write. No one will have Read&Execute.

So, I suppose we could rely on Cygwin to manage execution permission for
appropriate users/groups.

Shawn Pearce wrote:

> Dmitry Smirnov wrote:
>> I see there was some bug reported related to this problem
>>
( http://code.google.com/p/egit/issues/detail?id=3&colspec =ID%20Type%20Status%20Priority%20Component%20Owner%20Summary)
>>
>>
>> But it is unclear what is the status of it.
>>
>> I'm working on Windows and use Cygwin-based git sometimes, so this
>> problem a little bit annoying.
>> I see that neither FS_Win32.java nor FS_Win32_Cygwin.java does not
>> handle canExecute and setExecute properly.
>>
>> Meantime, I suppose there could be some ways to fix it. For
>> FS_Win32.java it could be some native code. FS_Win32_Cygwin.java could
>> use 'chmod', for example.

> You are right, the FS_Win32 implementations disable the setExecute
> method support, even if the JVM is a Java 6 variant with setExecute
> available in the java.io.File class.

> For some reason commit 1432c8b2dd[1] says the setExecute method is
> useless on Win32, but I don't remember why I wrote that. IIRC it was
> something about every file being executable on Windows, no matter what,
> which really disagreed with Git's concept of executable, especially in a
> Cygwin based repository.

> As for status of this bug, nobody is working on it right now, so its
> just hanging out there. :-(

> [1]
>
http://repo.or.cz/w/jgit.git?a=commit;h=1432c8b2ddbabdd285715fbe7a0be58e36014df5
Re: Executable flags [message #10986 is a reply to message #10942] Wed, 22 July 2009 20:43 Go to previous message
Robin Rosenberg is currently offline Robin RosenbergFriend
Messages: 332
Registered: July 2009
Senior Member
Shawn Pearce wrote:

> Dmitry Smirnov wrote:
>> I see there was some bug reported related to this problem
>>
( http://code.google.com/p/egit/issues/detail?id=3&colspec =ID%20Type%20Status%20Priority%20Component%20Owner%20Summary)
>>
>>
>> But it is unclear what is the status of it.
>>
>> I'm working on Windows and use Cygwin-based git sometimes, so this
>> problem a little bit annoying.
>> I see that neither FS_Win32.java nor FS_Win32_Cygwin.java does not
>> handle canExecute and setExecute properly.
>>
>> Meantime, I suppose there could be some ways to fix it. For
>> FS_Win32.java it could be some native code. FS_Win32_Cygwin.java could
>> use 'chmod', for example.
>
> You are right, the FS_Win32 implementations disable the setExecute
> method support, even if the JVM is a Java 6 variant with setExecute
> available in the java.io.File class.
>
> For some reason commit 1432c8b2dd[1] says the setExecute method is
> useless on Win32, but I don't remember why I wrote that. IIRC it was
> something about every file being executable on Windows, no matter what,
> which really disagreed with Git's concept of executable, especially in a
> Cygwin based repository.
>
> As for status of this bug, nobody is working on it right now, so its
> just hanging out there. :-(

Well, I accepted the patch, because the execute bit is ill-defined on
Windows. Java has only one bit, cygwin has several and Windows doesn't
have a bit, but access control lists, which usually maps for the posix
bit and posix ACL's, but not completely. We can ignore most of the
problems for git here, as the execute bit in java pretty much matches
the execute bit concept as seen by git. We might still get into conflicts
with cygwin though, but maybe that's not our problem.

A more real problem is that Windows editors tend to set this bit when it's
not needed to you usually get it wrongly set when creating files on Windows.

I don't think much would get destroyed if we enable the bit for windows.
Btw, note that cygwinfs isn't detected unless you have cygwin in your path
or launches Eclipse from cygwin. We should also respect the core.filemode
flags set. A problem here is that on Windows msysgit/cygwin git sets it in
/etc/gitconfig, which is located, well "somewhere".

It might also be a performance issue to enable it since the file properties
or poorly handled by java. I was thinking about trying to reuse the
information Eclipse caches via resources someday.

-- robin
Re: Executable flags [message #573613 is a reply to message #10932] Tue, 21 July 2009 23:30 Go to previous message
Shawn O. Pearce is currently offline Shawn O. PearceFriend
Messages: 82
Registered: July 2009
Member
Dmitry Smirnov wrote:
> I see there was some bug reported related to this problem
> ( http://code.google.com/p/egit/issues/detail?id=3&colspec =ID%20Type%20Status%20Priority%20Component%20Owner%20Summary)
>
>
> But it is unclear what is the status of it.
>
> I'm working on Windows and use Cygwin-based git sometimes, so this
> problem a little bit annoying.
> I see that neither FS_Win32.java nor FS_Win32_Cygwin.java does not
> handle canExecute and setExecute properly.
>
> Meantime, I suppose there could be some ways to fix it. For
> FS_Win32.java it could be some native code. FS_Win32_Cygwin.java could
> use 'chmod', for example.

You are right, the FS_Win32 implementations disable the setExecute
method support, even if the JVM is a Java 6 variant with setExecute
available in the java.io.File class.

For some reason commit 1432c8b2dd[1] says the setExecute method is
useless on Win32, but I don't remember why I wrote that. IIRC it was
something about every file being executable on Windows, no matter what,
which really disagreed with Git's concept of executable, especially in a
Cygwin based repository.

As for status of this bug, nobody is working on it right now, so its
just hanging out there. :-(

[1]
http://repo.or.cz/w/jgit.git?a=commit;h=1432c8b2ddbabdd285715fbe7a0be58e36014df5
Re: Executable flags [message #573693 is a reply to message #10942] Wed, 22 July 2009 12:57 Go to previous message
Dmitry Smirnov is currently offline Dmitry SmirnovFriend
Messages: 92
Registered: July 2009
Member
Where can find info about "Git's concept of executable"?

I had played with some file on my machine.

Gygwin reports the following
D:\>ls -l artifacts.xml
-rwxrwxrwx 1 dsmirnov Russia_Eng 1270894 Jun 29 15:08 artifacts.xml

Windows file Properties->security shows that "Everyone" has Read&Execute
permissions (among others, including Full Control).

If I turn off executable flags with Cygwin (chmod 644), properties will
show 2 more users/groups (Domain Users and me personally). Both Domain
Users and Everyone will have only Read permission, while me having Read
and Write. No one will have Read&Execute.

So, I suppose we could rely on Cygwin to manage execution permission for
appropriate users/groups.

Shawn Pearce wrote:

> Dmitry Smirnov wrote:
>> I see there was some bug reported related to this problem
>>
( http://code.google.com/p/egit/issues/detail?id=3&colspec =ID%20Type%20Status%20Priority%20Component%20Owner%20Summary)
>>
>>
>> But it is unclear what is the status of it.
>>
>> I'm working on Windows and use Cygwin-based git sometimes, so this
>> problem a little bit annoying.
>> I see that neither FS_Win32.java nor FS_Win32_Cygwin.java does not
>> handle canExecute and setExecute properly.
>>
>> Meantime, I suppose there could be some ways to fix it. For
>> FS_Win32.java it could be some native code. FS_Win32_Cygwin.java could
>> use 'chmod', for example.

> You are right, the FS_Win32 implementations disable the setExecute
> method support, even if the JVM is a Java 6 variant with setExecute
> available in the java.io.File class.

> For some reason commit 1432c8b2dd[1] says the setExecute method is
> useless on Win32, but I don't remember why I wrote that. IIRC it was
> something about every file being executable on Windows, no matter what,
> which really disagreed with Git's concept of executable, especially in a
> Cygwin based repository.

> As for status of this bug, nobody is working on it right now, so its
> just hanging out there. :-(

> [1]
>
http://repo.or.cz/w/jgit.git?a=commit;h=1432c8b2ddbabdd285715fbe7a0be58e36014df5
Re: Executable flags [message #573713 is a reply to message #10942] Wed, 22 July 2009 20:43 Go to previous message
Robin Rosenberg is currently offline Robin RosenbergFriend
Messages: 332
Registered: July 2009
Senior Member
Shawn Pearce wrote:

> Dmitry Smirnov wrote:
>> I see there was some bug reported related to this problem
>>
( http://code.google.com/p/egit/issues/detail?id=3&colspec =ID%20Type%20Status%20Priority%20Component%20Owner%20Summary)
>>
>>
>> But it is unclear what is the status of it.
>>
>> I'm working on Windows and use Cygwin-based git sometimes, so this
>> problem a little bit annoying.
>> I see that neither FS_Win32.java nor FS_Win32_Cygwin.java does not
>> handle canExecute and setExecute properly.
>>
>> Meantime, I suppose there could be some ways to fix it. For
>> FS_Win32.java it could be some native code. FS_Win32_Cygwin.java could
>> use 'chmod', for example.
>
> You are right, the FS_Win32 implementations disable the setExecute
> method support, even if the JVM is a Java 6 variant with setExecute
> available in the java.io.File class.
>
> For some reason commit 1432c8b2dd[1] says the setExecute method is
> useless on Win32, but I don't remember why I wrote that. IIRC it was
> something about every file being executable on Windows, no matter what,
> which really disagreed with Git's concept of executable, especially in a
> Cygwin based repository.
>
> As for status of this bug, nobody is working on it right now, so its
> just hanging out there. :-(

Well, I accepted the patch, because the execute bit is ill-defined on
Windows. Java has only one bit, cygwin has several and Windows doesn't
have a bit, but access control lists, which usually maps for the posix
bit and posix ACL's, but not completely. We can ignore most of the
problems for git here, as the execute bit in java pretty much matches
the execute bit concept as seen by git. We might still get into conflicts
with cygwin though, but maybe that's not our problem.

A more real problem is that Windows editors tend to set this bit when it's
not needed to you usually get it wrongly set when creating files on Windows.

I don't think much would get destroyed if we enable the bit for windows.
Btw, note that cygwinfs isn't detected unless you have cygwin in your path
or launches Eclipse from cygwin. We should also respect the core.filemode
flags set. A problem here is that on Windows msysgit/cygwin git sets it in
/etc/gitconfig, which is located, well "somewhere".

It might also be a performance issue to enable it since the file properties
or poorly handled by java. I was thinking about trying to reuse the
information Eclipse caches via resources someday.

-- robin
Previous Topic:JGit?
Next Topic:Git reporting "Not a git repository"
Goto Forum:
  


Current Time: Tue Apr 16 15:08:27 GMT 2024

Powered by FUDForum. Page generated in 0.04793 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top