{"thread":{"id":"20212","subject":"[PATCH/RFC] SunOS grep does not understand -C<n>","startedAt":"2009-07-24T05:30:07Z","lastAt":"2009-12-26T09:09:08Z","messageCount":8,"participants":["Junio C Hamano","Jeff King","Brandon Casey"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"118611","messageId":"7vr5w6tzq8.fsf@alter.siamese.dyndns.org","threadId":"20212","inReplyTo":null,"subject":"[PATCH/RFC] SunOS grep does not understand -C<n>","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-07-24T05:30:07Z","receivedAt":"2009-07-24T05:30:07Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"I noticed that the first \"grep -C1\" test in t7002 does not pass on my \nSunOS-5.11-i86pc, and that is not because our way to spawn external\ngrep is broken, but because the native grep does not understand -C<n>.\n\nIs it just me and my installation (i.e. I might have failed to install\nsaner grep from the distribution that everybody uses), or everybody on\nSunOS is using this option himself because our Makefile doesn't do that\nautomatically for them?\n\nJust in case it is the latter, here is a proposed patch.\n\n---\n Makefile |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex bde27ed..daf4296 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -728,6 +728,7 @@ ifeq ($(uname_S),SunOS)\n \tNO_MKDTEMP = YesPlease\n \tNO_MKSTEMPS = YesPlease\n \tNO_REGEX = YesPlease\n+\tNO_EXTERNAL_GREP = YesPlease\n \tifeq ($(uname_R),5.7)\n \t\tNEEDS_RESOLV = YesPlease\n \t\tNO_IPV6 = YesPlease\n"},{"id":"118614","messageId":"20090724054144.GC6563@sigill.intra.peff.net","threadId":"20212","inReplyTo":"7vr5w6tzq8.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH/RFC] SunOS grep does not understand -C<n>","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-07-24T05:41:45Z","receivedAt":"2009-07-24T05:41:45Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Jul 23, 2009 at 10:30:07PM -0700, Junio C Hamano wrote:\n\n> I noticed that the first \"grep -C1\" test in t7002 does not pass on my \n> SunOS-5.11-i86pc, and that is not because our way to spawn external\n> grep is broken, but because the native grep does not understand -C<n>.\n> \n> Is it just me and my installation (i.e. I might have failed to install\n> saner grep from the distribution that everybody uses), or everybody on\n> SunOS is using this option himself because our Makefile doesn't do that\n> automatically for them?\n> \n> Just in case it is the latter, here is a proposed patch.\n\nYes, I've been building with NO_EXTERNAL_GREP for my test box. The grep\nfrom Solaris 8, at least, doesn't understand '-e' either, which causes\nit to fail many other tests.\n\n-Peff\n"},{"id":"118615","messageId":"7vbpnasiiz.fsf@alter.siamese.dyndns.org","threadId":"20212","inReplyTo":"20090724054144.GC6563@sigill.intra.peff.net","subject":"Re: [PATCH/RFC] SunOS grep does not understand -C<n>","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-07-24T06:27:00Z","receivedAt":"2009-07-24T06:27:00Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> On Thu, Jul 23, 2009 at 10:30:07PM -0700, Junio C Hamano wrote:\n>\n>> I noticed that the first \"grep -C1\" test in t7002 does not pass on my \n>> SunOS-5.11-i86pc, and that is not because our way to spawn external\n>> grep is broken, but because the native grep does not understand -C<n>.\n>> \n>> Is it just me and my installation (i.e. I might have failed to install\n>> saner grep from the distribution that everybody uses), or everybody on\n>> SunOS is using this option himself because our Makefile doesn't do that\n>> automatically for them?\n>> \n>> Just in case it is the latter, here is a proposed patch.\n>\n> Yes, I've been building with NO_EXTERNAL_GREP for my test box. The grep\n> from Solaris 8, at least, doesn't understand '-e' either, which causes\n> it to fail many other tests.\n\nThanks.\n\nJust to double check, do we have \"grep -e\" (not \"git grep -e\") that makes\nSolaris fail?  I didn't notice.  Or do you mean \"git grep -e\" fails\nwithout NO_EXTERNAL_GREP?\n"},{"id":"118616","messageId":"7v7hxysie9.fsf@alter.siamese.dyndns.org","threadId":"20212","inReplyTo":"7vr5w6tzq8.fsf@alter.siamese.dyndns.org","subject":"[PATCH/RFC] FreeBSD iconv function signature is \"old\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-07-24T06:29:50Z","receivedAt":"2009-07-24T06:29:50Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"I noticed that my build on FreeBSD-7.2-RELEASE-i386 fails without\nOLD_ICONV=YesPlease.\n\nIs it just me and my installation (i.e. I might have failed to install\nsaner iconv from the port that everybody uses), or is everybody who runs\non FreeBSD using this option himself because our Makefile doesn't do that\nautomatically for them?\n\nJust in case it is the latter, here is a proposed patch.\n\n---\n\n Makefile |    1 +\n 1 files changed, 1 insertions(+), 0 deletions(-)\n\ndiff --git a/Makefile b/Makefile\nindex bde27ed..9a25c08 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -777,6 +777,7 @@ ifeq ($(uname_O),Cygwin)\n endif\n ifeq ($(uname_S),FreeBSD)\n \tNEEDS_LIBICONV = YesPlease\n+\tOLD_ICONV = YesPlease\n \tNO_MEMMEM = YesPlease\n \tBASIC_CFLAGS += -I/usr/local/include\n \tBASIC_LDFLAGS += -L/usr/local/lib\n"},{"id":"118617","messageId":"20090724070925.GA2353@sigill.intra.peff.net","threadId":"20212","inReplyTo":"7vbpnasiiz.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH/RFC] SunOS grep does not understand -C<n>","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2009-07-24T07:09:25Z","receivedAt":"2009-07-24T07:09:25Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Thu, Jul 23, 2009 at 11:27:00PM -0700, Junio C Hamano wrote:\n\n> > Yes, I've been building with NO_EXTERNAL_GREP for my test box. The grep\n> > from Solaris 8, at least, doesn't understand '-e' either, which causes\n> > it to fail many other tests.\n> \n> Thanks.\n> \n> Just to double check, do we have \"grep -e\" (not \"git grep -e\") that makes\n> Solaris fail?  I didn't notice.  Or do you mean \"git grep -e\" fails\n> without NO_EXTERNAL_GREP?\n\nI meant the latter; t7002 tests \"git grep -e\", which fails without\nNO_EXTERNAL_GREP.\n\n-Peff\n"},{"id":"118632","messageId":"bkmAA5IX0ZzfCv66mQCX1GFfM5XwTCDPMQk5LjxMd37QH7PwYK29XA@cipher.nrlssc.navy.mil","threadId":"20212","inReplyTo":"7vr5w6tzq8.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH/RFC] SunOS grep does not understand -C<n>","fromName":"Brandon Casey","fromEmail":"brandon.casey.ctr@nrlssc.navy.mil","sentAt":"2009-07-24T15:43:22Z","receivedAt":"2009-07-24T15:43:22Z","isPatch":true,"sender":{"key":"brandon.casey.ctr@nrlssc.navy.mil","avatar":null},"body":"Junio C Hamano wrote:\n> I noticed that the first \"grep -C1\" test in t7002 does not pass on my \n> SunOS-5.11-i86pc, and that is not because our way to spawn external\n> grep is broken, but because the native grep does not understand -C<n>.\n> \n> Is it just me and my installation (i.e. I might have failed to install\n> saner grep from the distribution that everybody uses), or everybody on\n> SunOS is using this option himself because our Makefile doesn't do that\n> automatically for them?\n\nHmm.  I have _not_ been setting NO_EXTERNAL_GREP and the tests have _not_\nbeen failing.\n\nThe system grep does not seem to have the -C option:\n\n   # /usr/xpg4/bin/grep -C1 include ws.c\n   /usr/xpg4/bin/grep: illegal option -- C\n   Usage:  grep [-E|-F] [-c|-l|-q] [-bhinsvwx] [file ...]\n   grep [-E|-F] [-c|-l|-q] [-bhinsvwx] -e pattern... [-f pattern_file]...[file...]\n   grep [-E|-F] [-c|-l|-q] [-bhinsvwx] [-e pattern]... -f pattern_file [file...]\n\nbut git grep -C1 works fine\n\n   # git grep -C1 include ws.c\n   ws.c-\n   ws.c:#include \"cache.h\"\n   ws.c:#include \"attr.h\"\n   ws.c-\n\nI have been compiling with the SUNWspro compiler suite though, and I see these\nstatements in builtin-grep.c:\n\n   #ifndef NO_EXTERNAL_GREP\n   #ifdef __unix__\n   #define NO_EXTERNAL_GREP 0\n   #else\n   #define NO_EXTERNAL_GREP 1\n   #endif\n   #endif\n\nSo possibly, the SUNWspro compiler does not set the __unix__ macro.  A quick\ncompile of a test program confirms it.\n\n   #include <stdio.h>\n\n   int main (int argc, char* argv[])\n   {\n   #ifdef __unix__\n   \tputs(\"__unix__ is set\");\n   #else\n   \tputs(\"__unix__ is not set\");\n   #endif\n   \treturn 0;\n   }\n\n   # /opt/SUNWspro/bin/cc -o test.out test.c\n   ./test.out\n   __unix__ is not set\n\n   # gcc -o test.out test.c\n   __unix__ is set\n\nSo, I have been getting NO_EXTERNAL_GREP all along without knowing it.\n\n-brandon\n"},{"id":"118633","messageId":"7vprbqnkic.fsf@alter.siamese.dyndns.org","threadId":"20212","inReplyTo":"bkmAA5IX0ZzfCv66mQCX1GFfM5XwTCDPMQk5LjxMd37QH7PwYK29XA@cipher.nrlssc.navy.mil","subject":"Re: [PATCH/RFC] SunOS grep does not understand -C<n>","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-07-24T15:55:23Z","receivedAt":"2009-07-24T15:55:23Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Brandon Casey <brandon.casey.ctr@nrlssc.navy.mil> writes:\n\n> So, I have been getting NO_EXTERNAL_GREP all along without knowing it.\n\nThanks for a detailed analysis.  I use gcc, and I suspect Peff also does.\nSo it seems that I should apply my \"in case it is the latter\" patch.\n\nThanks.\n"},{"id":"130345","messageId":"7vr5qi6r0r.fsf@alter.siamese.dyndns.org","threadId":"20212","inReplyTo":"7v7hxysie9.fsf@alter.siamese.dyndns.org","subject":"[PATCH/RFC] FreeBSD iconv function signature is \"old\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-12-26T09:09:08Z","receivedAt":"2009-12-26T09:09:08Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> I noticed that my build on FreeBSD-7.2-RELEASE-i386 fails without\n> OLD_ICONV=YesPlease.\n>\n> Is it just me and my installation (i.e. I might have failed to install\n> saner iconv from the port that everybody uses), or is everybody who runs\n> on FreeBSD using this option himself because our Makefile doesn't do that\n> automatically for them?\n>\n> Just in case it is the latter, here is a proposed patch.\n\nBy the way, FreeBSD-8.0-RELEASE-i386 has the same issue.  I'll queue it to\n'maint' unless anybody objects...\n\n>  Makefile |    1 +\n>  1 files changed, 1 insertions(+), 0 deletions(-)\n>\n> diff --git a/Makefile b/Makefile\n> index bde27ed..9a25c08 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -777,6 +777,7 @@ ifeq ($(uname_O),Cygwin)\n>  endif\n>  ifeq ($(uname_S),FreeBSD)\n>  \tNEEDS_LIBICONV = YesPlease\n> +\tOLD_ICONV = YesPlease\n>  \tNO_MEMMEM = YesPlease\n>  \tBASIC_CFLAGS += -I/usr/local/include\n>  \tBASIC_LDFLAGS += -L/usr/local/lib\n"}]}