From: Christian Himpel <chressie@googlemail.com>
To: git@vger.kernel.org
Subject: [PATCH 2/2] git-am: force egrep to use correct characters set
Date: Fri, 25 Sep 2009 17:17:31 +0200 [thread overview]
Message-ID: <dc8a4205128d65e69587292a42c714792315a9df.1253891124.git.chressie@gmail.com> (raw)
In-Reply-To: <d7d039c304614d8d39fd2e7ad8d036a77121cc4f.1253891124.git.chressie@gmail.com>
According to egrep(1) the US-ASCII table is used when LC_ALL=C is set.
We do not rely here on the LC_ALL value we get from the environment.
Signed-off-by: Christian Himpel <chressie@gmail.com>
---
I don't know if this kind of patch is desired, but according to egrep(1)
it's not reliable to use the range expression with different character
sets than US-ASCII.
So this patch forces the usage of US-ASCII.
Regards,
chressie
git-am.sh | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/git-am.sh b/git-am.sh
index 0ddd80f..e4dd49a 100755
--- a/git-am.sh
+++ b/git-am.sh
@@ -204,9 +204,13 @@ check_patch_format () {
# discarding the indented remainder of folded lines,
# and see if it looks like that they all begin with the
# header field names...
+ _tmp_locale=$LC_ALL
+ export LC_ALL=C
sed -n -e '/^$/q' -e '/^[ ]/d' -e p "$1" |
egrep -v '^[!-9;-~]+:' >/dev/null ||
patch_format=mbox
+ export LC_ALL=$_tmp_locale
+ unset $_tmp_locale
fi
} < "$1" || clean_abort
}
--
1.6.4.4
next prev parent reply other threads:[~2009-09-25 15:17 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-25 15:14 [PATCH 1/2] git-am: fixed patch_format detection according to RFC2822 Christian Himpel
2009-09-25 15:17 ` Christian Himpel [this message]
2009-09-25 15:45 ` [PATCH 2/2 v2] git-am: force egrep to use correct characters set Christian Himpel
2009-09-25 16:43 ` [PATCH] " Christian Himpel
2009-09-27 7:40 ` Jeff King
2009-09-28 6:55 ` Christian Himpel
2009-09-28 7:16 ` Jeff King
2009-09-28 8:12 ` Johannes Sixt
2009-09-28 9:32 ` Christian Himpel
2009-09-28 9:53 ` Johannes Sixt
2009-09-28 12:09 ` Christian Himpel
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=dc8a4205128d65e69587292a42c714792315a9df.1253891124.git.chressie@gmail.com \
--to=chressie@googlemail.com \
--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).