Re: [PATCH 1/2] Move the pick_author code to git-sh-setup

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH 1/2] Move the pick_author code to git-sh-setup

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:43:18

Johannes Schindelin [off-list ref] writes:
-	set_author_env=`git show -s --pretty=raw --encoding="$encoding" "$use_commit" |
-	LANG=C LC_ALL=C sed -ne "$pick_author_script"`
-	eval "$set_author_env"
...
+	eval $(get_author_ident_from_commit "$use_commit")
Are you sure about this part of the change?  I suspect that you
are losing IFS by not dq'ing the argument you give to the eval.

    #!/bin/sh

    test1 () {
        echo "$1=' d  e'"
    }

    eval $(test1 A)
    eval "$(test1 B)"
    echo "A=$A"
    echo "B=$B"

Re: [PATCH 1/2] Move the pick_author code to git-sh-setup

From: Johannes Schindelin <hidden>
Date: 2016-06-15 22:43:18

Hi,

On Sat, 23 Jun 2007, Junio C Hamano wrote:
Johannes Schindelin [off-list ref] writes:
quoted
-	set_author_env=`git show -s --pretty=raw --encoding="$encoding" "$use_commit" |
-	LANG=C LC_ALL=C sed -ne "$pick_author_script"`
-	eval "$set_author_env"
...
+	eval $(get_author_ident_from_commit "$use_commit")
Are you sure about this part of the change?
No, I am not.
I suspect that you are losing IFS by not dq'ing the argument you give to 
the eval.
That is well possible. Quoting in shell is such a hassle, and I never seem 
to get it right.

Therefore I did a minimal test, namely committing with another 
GIT_AUTHOR_NAME (which has spaces in it), and then commiting again, with 
"-c HEAD". Which did what I expected: the second commit had the same 
author name as the first one.

So I thought that it was okay.

Ciao,
Dscho
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help