Re: [PATCH] help: correct behavior for is_executable on Windows

2017-01-30 Thread Johannes Schindelin
Hi Junio, On Fri, 27 Jan 2017, Junio C Hamano wrote: > Johannes Schindelin writes: > > > From: Heiko Voigt > > > > The previous implementation said that the filesystem information on > > Windows is not reliable to determine whether a file is executable. To > > gather this information it was pe

Re: [PATCH] help: correct behavior for is_executable on Windows

2017-01-27 Thread Junio C Hamano
Johannes Schindelin writes: > From: Heiko Voigt > > The previous implementation said that the filesystem information on > Windows is not reliable to determine whether a file is executable. To > gather this information it was peeking into the first two bytes of a > file to see whether it looks ex

[PATCH] help: correct behavior for is_executable on Windows

2017-01-27 Thread Johannes Schindelin
From: Heiko Voigt The previous implementation said that the filesystem information on Windows is not reliable to determine whether a file is executable. To gather this information it was peeking into the first two bytes of a file to see whether it looks executable. Apart from the fact that on Wi

Re: [PATCH] help: correct behavior for is_executable on Windows

2012-08-16 Thread Heiko Voigt
Hi Junio, On Wed, Aug 15, 2012 at 07:02:31PM -0700, Junio C Hamano wrote: > Junio C Hamano writes: > > > My preference is to remove "static int is_executable()" function > > from help.c, have an... > > ... I wouldn't mind seeing the implementation of posix_is_executable() > > in help.c, which wi

Re: [PATCH] help: correct behavior for is_executable on Windows

2012-08-15 Thread Junio C Hamano
Junio C Hamano writes: > My preference is to remove "static int is_executable()" function > from help.c, have an... > ... I wouldn't mind seeing the implementation of posix_is_executable() > in help.c, which will be dead-code on Windows and Cygwin, if that > makes linking and Makefile easier. An

Re: [PATCH] help: correct behavior for is_executable on Windows

2012-08-15 Thread Junio C Hamano
Heiko Voigt writes: > I do not know why you are against filling that information into "struct > stat". Because it is *WRONG*. Isn't it a good enough reason? If the issue you are trying to solve were """stat emulation on Windows and Cygwin does not give the correct x-bit (and the user sometimes

Re: [PATCH] help: correct behavior for is_executable on Windows

2012-08-15 Thread Heiko Voigt
Hi Junio, On Wed, Aug 15, 2012 at 10:53:55AM -0700, Junio C Hamano wrote: > Heiko Voigt writes: > > > On Mon, Aug 13, 2012 at 10:48:14AM -0700, Junio C Hamano wrote: > >> Heiko Voigt writes: > >> > What do you think? > >> > >> Does having the "stat()" help on Windows in any way? Does it ever

Re: [PATCH] help: correct behavior for is_executable on Windows

2012-08-15 Thread Junio C Hamano
Junio C Hamano writes: >> diff --git a/help.c b/help.c >> ... >> + > > Yuck. > > Why should we need even a single line of the implementation of a > function that tells if a given pathname contains an executable > command, which we know is platform specific? Sorry; sent without sufficient proof

Re: [PATCH] help: correct behavior for is_executable on Windows

2012-08-15 Thread Junio C Hamano
Heiko Voigt writes: > On Mon, Aug 13, 2012 at 10:48:14AM -0700, Junio C Hamano wrote: >> Heiko Voigt writes: >> > What do you think? >> >> Does having the "stat()" help on Windows in any way? Does it ever >> return an executable bit by itself? > > No, AFAIK it does not return anything about ex

Re: [PATCH] help: correct behavior for is_executable on Windows

2012-08-15 Thread Heiko Voigt
Hi Junio, On Mon, Aug 13, 2012 at 10:48:14AM -0700, Junio C Hamano wrote: > Heiko Voigt writes: > > What do you think? > > Does having the "stat()" help on Windows in any way? Does it ever > return an executable bit by itself? No, AFAIK it does not return anything about executability. But I th

Re: [PATCH] help: correct behavior for is_executable on Windows

2012-08-13 Thread Junio C Hamano
Heiko Voigt writes: > Since the code for cygwin and windows in general is almost the same I would > extract one function for them where I leave in one ifdef for cygwin. > > E.g. like this: > > > static int is_executable(const char *name) > { > struct stat st; > >

Re: [PATCH] help: correct behavior for is_executable on Windows

2012-08-13 Thread Heiko Voigt
On Sat, Aug 11, 2012 at 09:30:06PM -0700, Junio C Hamano wrote: > Heiko Voigt writes: > > > help.c | 15 --- > > 1 file changed, 12 insertions(+), 3 deletions(-) > > > > diff --git a/help.c b/help.c > > index 662349d..b41fa21 100644 > > --- a/help.c > > +++ b/help.c > > @@ -103,10 +1

Re: [PATCH] help: correct behavior for is_executable on Windows

2012-08-11 Thread Junio C Hamano
Heiko Voigt writes: > help.c | 15 --- > 1 file changed, 12 insertions(+), 3 deletions(-) > > diff --git a/help.c b/help.c > index 662349d..b41fa21 100644 > --- a/help.c > +++ b/help.c > @@ -103,10 +103,19 @@ static int is_executable(const char *name) > return 0; > >

[PATCH] help: correct behavior for is_executable on Windows

2012-08-11 Thread Heiko Voigt
The previous implementation said that the filesystem information on Windows is not reliable to determine whether a file is executable. To find gather this information it was peeking into the first two bytes of a file to see whether it looks executable. Apart from the fact that on Windows executable