Re: [PATCH 3/8] ls_colors.c: enable coloring on u+x files

2014-03-21 Thread Duy Nguyen
On Fri, Mar 21, 2014 at 12:41 AM, Junio C Hamano gits...@pobox.com wrote:
 Why even include cache.h for S_IXUSR?

 In the context of the patch I see S_ISGID mentioned and other S_*
 st_mode things are already in use in this function before this step,
 and presumably you are using them without problems, no?

My mistake. git-compat-util.h does include S_IXUSR. The original code
was S_IXUGO that's in neither files.
-- 
Duy
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/8] ls_colors.c: enable coloring on u+x files

2014-03-20 Thread Nguyễn Thái Ngọc Duy
git-compat-util.h does not seem to carry S_IXUGO. Anyway as far as Git
is concerned, we only care one executable bit. Hard code it.

Signed-off-by: Nguyễn Thái Ngọc Duy pclo...@gmail.com
---
 ls_colors.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/ls_colors.c b/ls_colors.c
index d492ab3..23f1e0b 100644
--- a/ls_colors.c
+++ b/ls_colors.c
@@ -427,10 +427,8 @@ void print_color_indicator(const char *name, mode_t mode, 
int linkok,
type = C_SETUID;
else if ((mode  S_ISGID) != 0)
type = C_SETGID;
-#if 0
-   else if ((mode  S_IXUGO) != 0)
+   else if ((mode  0100) != 0)
type = C_EXEC;
-#endif
} else if (S_ISDIR(mode)) {
if ((mode  S_ISVTX)  (mode  S_IWOTH))
type = C_STICKY_OTHER_WRITABLE;
-- 
1.9.0.40.gaa8c3ea

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/8] ls_colors.c: enable coloring on u+x files

2014-03-20 Thread Matthieu Moy
Nguyễn Thái Ngọc Duy pclo...@gmail.com writes:

 git-compat-util.h does not seem to carry S_IXUGO. Anyway as far as Git
 is concerned, we only care one executable bit. Hard code it.

Why not use S_IXUSR instead of a hardcoded value? (already used in
path.c, so shouldn't be a problem wrt portability)

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/8] ls_colors.c: enable coloring on u+x files

2014-03-20 Thread Duy Nguyen
On Thu, Mar 20, 2014 at 6:46 PM, Matthieu Moy
matthieu@grenoble-inp.fr wrote:
 Nguyễn Thái Ngọc Duy pclo...@gmail.com writes:

 git-compat-util.h does not seem to carry S_IXUGO. Anyway as far as Git
 is concerned, we only care one executable bit. Hard code it.

 Why not use S_IXUSR instead of a hardcoded value? (already used in
 path.c, so shouldn't be a problem wrt portability)

Hmm..maybe cache.h does something to that macro. Will drop this patch
and include cache.h.
-- 
Duy
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/8] ls_colors.c: enable coloring on u+x files

2014-03-20 Thread Junio C Hamano
Duy Nguyen pclo...@gmail.com writes:

 On Thu, Mar 20, 2014 at 6:46 PM, Matthieu Moy
 matthieu@grenoble-inp.fr wrote:
 Nguyễn Thái Ngọc Duy pclo...@gmail.com writes:

 git-compat-util.h does not seem to carry S_IXUGO. Anyway as far as Git
 is concerned, we only care one executable bit. Hard code it.

 Why not use S_IXUSR instead of a hardcoded value? (already used in
 path.c, so shouldn't be a problem wrt portability)

 Hmm..maybe cache.h does something to that macro. Will drop this patch
 and include cache.h.

Why even include cache.h for S_IXUSR?

In the context of the patch I see S_ISGID mentioned and other S_*
st_mode things are already in use in this function before this step,
and presumably you are using them without problems, no?
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html