Re: [PATCH] git-submodule add: Record branch name in .gitmodules
- From
Jeff King <peff@peff.net>
- Date
- Oct 26, 2012, 13:37 UTC
- Message-ID
- <20121026133742.GA10829@sigill.intra.peff.net>
- In-Reply-To
- <20121025011227.GH801@odin.tremily.us>
On Wed, Oct 24, 2012 at 09:12:27PM -0400, W. Trevor King wrote:
Show 5 quoted lines
> On Wed, Oct 24, 2012 at 02:12:18PM -0400, Phil Hord wrote: > > + VAR_NAME=$(printf '%s' > > "$VAR_NAME" | tr A-Z a-z | sed -e 's/^[^a-z]/_/' -e 's/[^a-z0-9]/_/g') > > Is there a reason why you use printf instead of echo?
Sadly, echo is not entirely portable for arbitrary content. We have run into problems with backslashes being interpreted differently (bash requires "echo -e" to interpret them, dash will always do it, and POSIX leaves it vague).
Show 7 quoted lines
> Also, this sort of name cleaning should probably live in a new > function: > > clean_environment_variable() > > or some such. Is there a git-utility-functions.sh library hiding > somewhere in the source? ;)
git-sh-setup?
-Peff