From: Brian Campbell <brian.p.campbell@Dartmouth.EDU>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: git@vger.kernel.org, Petr Baudis <pasky@suse.cz>,
Brian Campbell <brian.p.campbell@Dartmouth.EDU>
Subject: [PATCH 1/2] [TopGit] Portability: Use tr instead of sed for translating spaces to newlines
Date: Thu, 12 Mar 2009 01:56:28 -0400 [thread overview]
Message-ID: <1236837389-35687-1-git-send-email-brian.p.campbell@dartmouth.edu> (raw)
It is not portable to use \n in the replacement of a sed substitute
command. On Mac OS X (and presumably FreeBSD, as Mac OS X uses
sed from FreeBSD), \n in the replacement of a substitution gives a
literal "n" instead of a newline.
This patch replaces the sed command with tr, which should be more
portable.
Signed-off-by: Brian Campbell <brian.p.campbell@dartmouth.edu>
---
tg-create.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/tg-create.sh b/tg-create.sh
index 2edd537..ef9a955 100644
--- a/tg-create.sh
+++ b/tg-create.sh
@@ -116,7 +116,7 @@ done
git update-ref "refs/top-bases/$name" "HEAD" ""
git checkout -b "$name"
-echo "$deps" | sed 's/ /\n/g' >"$root_dir/.topdeps"
+echo "$deps" | tr ' ' '\n' >"$root_dir/.topdeps"
git add -f "$root_dir/.topdeps"
author="$(git var GIT_AUTHOR_IDENT)"
--
1.6.2.185.g8b635.dirty
next reply other threads:[~2009-03-12 6:11 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-12 5:56 Brian Campbell [this message]
2009-03-12 5:56 ` [PATCH 2/2] [TopGit] Portability: Don't use alternation ("|") in sed regular expressions Brian Campbell
2009-03-12 6:55 ` Junio C Hamano
2009-03-12 7:45 ` Uwe Kleine-König
2009-03-12 15:00 ` Brian Campbell
2009-03-12 15:20 ` Uwe Kleine-König
2009-03-12 15:26 ` martin f krafft
2009-03-14 5:54 ` Junio C Hamano
2009-03-14 12:47 ` Uwe Kleine-König
2009-03-12 16:41 ` Brian Campbell
2009-03-12 17:04 ` Uwe Kleine-König
2009-03-12 15:09 ` Uwe Kleine-König
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=1236837389-35687-1-git-send-email-brian.p.campbell@dartmouth.edu \
--to=brian.p.campbell@dartmouth.edu \
--cc=git@vger.kernel.org \
--cc=pasky@suse.cz \
--cc=u.kleine-koenig@pengutronix.de \
/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).