On 2014/02/06 14:29:23, Jakob wrote:
On 2014/02/06 14:12:02, palfia wrote:
> The problem here is that the "git log" command returns a newline separated
list,
> which can't be iterated with the for loop with the default IFS value. Of
course,
> if I change IFS to IFS=$'\n' then the for loop can split the string
correctly.
> However, I think that using the while loop is a cleaner way then changing
the
> IFS variable.

Agreed; if that's the case on your machine, then keeping the while-loop is
fine.

However, when I paste the following into a stand-alone shell script, it seems
to
work fine:

GIT_HASHES=$(git log svn/bleeding_edge --reverse \
              --format=%H --grep="Port r$REVISION" -5)
for GIT_HASH in $GIT_HASHES; do
   echo "found git hash: $GIT_HASH"
done

Hm, interesting. On my development laptop (ubuntu 12.04 with /bin/bash sha-bang)
it returns the following:
found git hash: cfcc58651517441d75dcb2a2224f21caafa750ca
5c80d13017705f74738c6d25e442c2ba90b3f650

But on our testing machine (with the same ubuntu version) it returns the correct
result. It seems that the while loop is a more portable solution.

https://codereview.chromium.org/152343011/

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to