git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Dougherty <doughera@lafayette.edu>
To: git@vger.kernel.org
Subject: [PATCH] Minor portability patch to git-submodule
Date: Mon, 17 Dec 2007 16:41:33 -0500 (EST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0712171639420.24957@fractal.phys.lafayette.edu> (raw)

While trying git out on Solaris 8, I needed the following patch.  
The 'grep' command on Solaris doesn't understand the -e option, though 
egrep does. 

More mysterious is the printf patch.  Without it, the sed command didn't 
match anything.

--- git-1.5.4.rc0/git-submodule.sh	Wed Dec 12 21:29:16 2007
+++ git-andy/git-submodule.sh	Mon Dec 17 14:30:46 2007
@@ -74,7 +74,7 @@
 module_name()
 {
 	# Do we have "submodule.<something>.path = $1" defined in .gitmodules file?
-	re=$(printf '%s' "$1" | sed -e 's/[].[^$\\*]/\\&/g')
+	re=$(printf '%s\n' "$1" | sed -e 's/[].[^$\\*]/\\&/g')
 	name=$( GIT_CONFIG=.gitmodules \
 		git config --get-regexp '^submodule\..*\.path$' |
 		sed -n -e 's|^submodule\.\(.*\)\.path '"$re"'$|\1|p' )
@@ -176,7 +176,7 @@
 #
 modules_init()
 {
-	git ls-files --stage -- "$@" | grep -e '^160000 ' |
+	git ls-files --stage -- "$@" | egrep -e '^160000 ' |
 	while read mode sha1 stage path
 	do
 		# Skip already registered paths
@@ -209,7 +209,7 @@
 #
 modules_update()
 {
-	git ls-files --stage -- "$@" | grep -e '^160000 ' |
+	git ls-files --stage -- "$@" | egrep -e '^160000 ' |
 	while read mode sha1 stage path
 	do
 		name=$(module_name "$path") || exit
@@ -268,7 +268,7 @@
 #
 modules_list()
 {
-	git ls-files --stage -- "$@" | grep -e '^160000 ' |
+	git ls-files --stage -- "$@" | egrep -e '^160000 ' |
 	while read mode sha1 stage path
 	do
 		name=$(module_name "$path") || exit

-- 
    Andy Dougherty		doughera@lafayette.edu

             reply	other threads:[~2007-12-17 22:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-17 21:41 Andy Dougherty [this message]
2007-12-17 22:54 ` [PATCH] Minor portability patch to git-submodule Johannes Schindelin
2007-12-18 13:35   ` Andy Dougherty
2007-12-18 14:01     ` Johannes Schindelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.0712171639420.24957@fractal.phys.lafayette.edu \
    --to=doughera@lafayette.edu \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).