Have you tried something like the following?
ssh torvalds@master.kernel.org \
'/bin/sh -c "export PATH=/tmp/foo:$PATH ; env"'
Linus Torvalds wrote:
...
>
Anyway, please do give it a test. I think I'll use this to sync up to
kernel.org, except I _really_ would want to solve that ssh issue some
other way than hardcoding the /home/torvalds/bin/ path in my local
copies.. If somebody knows a good solution, pls holler.