René Haber [off-list ref] writes:
sh -c '
. /sw/lib/git-core/git-sh-setup
get_author_ident_from_commit 16b94413cbce12531e8f946286851598449d3913
'
GIT_AUTHOR_NAME='Ren'é Haber
GIT_AUTHOR_EMAIL='rene@habr.de'
GIT_AUTHOR_DATE='@1329212923 +0100'
I think this is the same issue that we recently discussed on #git-devel,
where some broken versions of sed will fail to match "any character"
with '.' even under LC_ALL=C. Will "shruggar" Palmer (cc) had this
issue under OS X with a build of GNU sed that ignored LC_*.
You can verify that this is the problem by looking at
printf "\370\235\204\236\n" | LC_CTYPE=C sed 's/./x/g' | xxd
It should say
0000000: 7878 7878 0a xxxx.
That is, the garbage (if you try to read it as UTF-8) in the printf
string was matched and replaced byte-by-byte with 'x'. However,
Will was getting the unreplaced results
0000000: f89d 849e 0a .....
I'm not sure he has followed up on that problem; the only hope may be to
get a better 'sed'.
--
Thomas Rast
trast@{inf,student}.ethz.ch
Am 05.03.2012 um 14:04 schrieb Thomas Rast:
René Haber [off-list ref] writes:
quoted
sh -c '
. /sw/lib/git-core/git-sh-setup
get_author_ident_from_commit 16b94413cbce12531e8f946286851598449d3913
'
GIT_AUTHOR_NAME='Ren'é Haber
GIT_AUTHOR_EMAIL='rene@habr.de'
GIT_AUTHOR_DATE='@1329212923 +0100'
I think this is the same issue that we recently discussed on #git-devel,
where some broken versions of sed will fail to match "any character"
with '.' even under LC_ALL=C. Will "shruggar" Palmer (cc) had this
issue under OS X with a build of GNU sed that ignored LC_*.
You can verify that this is the problem by looking at
printf "\370\235\204\236\n" | LC_CTYPE=C sed 's/./x/g' | xxd
It should say
0000000: 7878 7878 0a xxxx.
That is, the garbage (if you try to read it as UTF-8) in the printf
string was matched and replaced byte-by-byte with 'x'. However,
Will was getting the unreplaced results
0000000: f89d 849e 0a .....
I'm not sure he has followed up on that problem; the only hope may be to
get a better 'sed'.
I can conform this. I get .....
Using the sed from apple results in xxxx.
Thanks.
René
--
Thomas Rast
trast@{inf,student}.ethz.ch
On Mon, Mar 05, 2012 at 02:04:37PM +0100, Thomas Rast wrote:
René Haber [off-list ref] writes:
quoted
sh -c '
. /sw/lib/git-core/git-sh-setup
get_author_ident_from_commit 16b94413cbce12531e8f946286851598449d3913
'
GIT_AUTHOR_NAME='Ren'é Haber
GIT_AUTHOR_EMAIL='rene@habr.de'
GIT_AUTHOR_DATE='@1329212923 +0100'
[...]
That is, the garbage (if you try to read it as UTF-8) in the printf
string was matched and replaced byte-by-byte with 'x'. However,
Will was getting the unreplaced results
0000000: f89d 849e 0a .....
I'm not sure he has followed up on that problem; the only hope may be to
get a better 'sed'.
Long ago, 47c9739e replaced the shell quoting in git-am with "git
rev-parse --sq-quote" (instead of sed). Maybe we can do the same for
get_author_ident_from_commit (though it is a little trickier there, as
we are also parsing values directly out of --pretty=raw).
It would be nice if the --pretty format placeholders had a "shell-quote"
modifier, and we could just do:
git show --format='GIT_AUTHOR_NAME=%(an:shell)'
or something similar. for-each-ref knows about shell-quoting, but we
can't use it here, because we are looking at arbitrary commits, not just
ones pointed to by refs.
-Peff