{"thread":{"id":"11329","subject":"[PATCH] Minor portability patch to git-submodule","startedAt":"2007-12-17T21:41:33Z","lastAt":"2007-12-18T14:01:28Z","messageCount":4,"participants":["Andy Dougherty","Johannes Schindelin"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"63502","messageId":"Pine.LNX.4.64.0712171639420.24957@fractal.phys.lafayette.edu","threadId":"11329","inReplyTo":null,"subject":"[PATCH] Minor portability patch to git-submodule","fromName":"Andy Dougherty","fromEmail":"doughera@lafayette.edu","sentAt":"2007-12-17T21:41:33Z","receivedAt":"2007-12-17T21:41:33Z","isPatch":true,"sender":{"key":"doughera@lafayette.edu","avatar":null},"body":"While trying git out on Solaris 8, I needed the following patch.  \nThe 'grep' command on Solaris doesn't understand the -e option, though \negrep does. \n\nMore mysterious is the printf patch.  Without it, the sed command didn't \nmatch anything.\n\n--- git-1.5.4.rc0/git-submodule.sh\tWed Dec 12 21:29:16 2007\n+++ git-andy/git-submodule.sh\tMon Dec 17 14:30:46 2007\n@@ -74,7 +74,7 @@\n module_name()\n {\n \t# Do we have \"submodule.<something>.path = $1\" defined in .gitmodules file?\n-\tre=$(printf '%s' \"$1\" | sed -e 's/[].[^$\\\\*]/\\\\&/g')\n+\tre=$(printf '%s\\n' \"$1\" | sed -e 's/[].[^$\\\\*]/\\\\&/g')\n \tname=$( GIT_CONFIG=.gitmodules \\\n \t\tgit config --get-regexp '^submodule\\..*\\.path$' |\n \t\tsed -n -e 's|^submodule\\.\\(.*\\)\\.path '\"$re\"'$|\\1|p' )\n@@ -176,7 +176,7 @@\n #\n modules_init()\n {\n-\tgit ls-files --stage -- \"$@\" | grep -e '^160000 ' |\n+\tgit ls-files --stage -- \"$@\" | egrep -e '^160000 ' |\n \twhile read mode sha1 stage path\n \tdo\n \t\t# Skip already registered paths\n@@ -209,7 +209,7 @@\n #\n modules_update()\n {\n-\tgit ls-files --stage -- \"$@\" | grep -e '^160000 ' |\n+\tgit ls-files --stage -- \"$@\" | egrep -e '^160000 ' |\n \twhile read mode sha1 stage path\n \tdo\n \t\tname=$(module_name \"$path\") || exit\n@@ -268,7 +268,7 @@\n #\n modules_list()\n {\n-\tgit ls-files --stage -- \"$@\" | grep -e '^160000 ' |\n+\tgit ls-files --stage -- \"$@\" | egrep -e '^160000 ' |\n \twhile read mode sha1 stage path\n \tdo\n \t\tname=$(module_name \"$path\") || exit\n\n-- \n    Andy Dougherty\t\tdoughera@lafayette.edu\n"},{"id":"63505","messageId":"Pine.LNX.4.64.0712172253150.9446@racer.site","threadId":"11329","inReplyTo":"Pine.LNX.4.64.0712171639420.24957@fractal.phys.lafayette.edu","subject":"Re: [PATCH] Minor portability patch to git-submodule","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-12-17T22:54:22Z","receivedAt":"2007-12-17T22:54:22Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 17 Dec 2007, Andy Dougherty wrote:\n\n> -\tgit ls-files --stage -- \"$@\" | grep -e '^160000 ' |\n> +\tgit ls-files --stage -- \"$@\" | egrep -e '^160000 ' |\n\nNack.  egrep is not available on all platforms.  But then I have to wonder \nwhy not saying \"grep '^160000 '\" instead?\n\nCiao,\nDscho\n"},{"id":"63605","messageId":"Pine.LNX.4.64.0712180734520.28219@fractal.phys.lafayette.edu","threadId":"11329","inReplyTo":"Pine.LNX.4.64.0712172253150.9446@racer.site","subject":"Re: [PATCH] Minor portability patch to git-submodule","fromName":"Andy Dougherty","fromEmail":"doughera@lafayette.edu","sentAt":"2007-12-18T13:35:53Z","receivedAt":"2007-12-18T13:35:53Z","isPatch":true,"sender":{"key":"doughera@lafayette.edu","avatar":null},"body":"On Mon, 17 Dec 2007, Johannes Schindelin wrote:\n\n> On Mon, 17 Dec 2007, Andy Dougherty wrote:\n> \n> > -\tgit ls-files --stage -- \"$@\" | grep -e '^160000 ' |\n> > +\tgit ls-files --stage -- \"$@\" | egrep -e '^160000 ' |\n> \n> Nack.  egrep is not available on all platforms.  But then I have to wonder \n> why not saying \"grep '^160000 '\" instead?\n\nYour last suggestion is easily and obviously better -- I'll assume you \ndon't need an explicit patch and can just hand-edit mine.  Still, I'd have \nthought egrep was fine.  As far as I recall, it goes back to v7 Unix.  Or \nare there non-unix systems at issue (perhaps cygwin variants or something) \nthat have grep but not egrep?\n\nAnyway, thanks.\n\n-- \n    Andy Dougherty\t\tdoughera@lafayette.edu\n"},{"id":"63608","messageId":"Pine.LNX.4.64.0712181357150.23902@racer.site","threadId":"11329","inReplyTo":"Pine.LNX.4.64.0712180734520.28219@fractal.phys.lafayette.edu","subject":"Re: [PATCH] Minor portability patch to git-submodule","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-12-18T14:01:28Z","receivedAt":"2007-12-18T14:01:28Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 18 Dec 2007, Andy Dougherty wrote:\n\n> On Mon, 17 Dec 2007, Johannes Schindelin wrote:\n> \n> > On Mon, 17 Dec 2007, Andy Dougherty wrote:\n> > \n> > > -\tgit ls-files --stage -- \"$@\" | grep -e '^160000 ' |\n> > > +\tgit ls-files --stage -- \"$@\" | egrep -e '^160000 ' |\n> > \n> > Nack.  egrep is not available on all platforms.  But then I have to \n> > wonder why not saying \"grep '^160000 '\" instead?\n> \n> Your last suggestion is easily and obviously better -- I'll assume you \n> don't need an explicit patch and can just hand-edit mine.  Still, I'd have \n> thought egrep was fine.  As far as I recall, it goes back to v7 Unix.\n\nThis is just another instance where we should look at existing systems \nand not so much at standards documents.\n\n> Or are there non-unix systems at issue (perhaps cygwin variants or \n> something) that have grep but not egrep?\n\nWell, I checked msysGit, and it has it.\n\nThat is, kind of: it is just a wrapper, calling \"grep -E\".  Which means \nyet another fork() on a fork() challenged platform, so I would appreciate \nit if we could avoid it.\n\nThanks,\nDscho\n"}]}