Is it possible to display nested command with git log --pretty

239 Views Asked by At

I came up with a one liner command to display the names, SHA-1 hashes and URLs of each submodule:

git submodule foreach --quiet "echo $name:$sha1: `git config --get remote.origin.url`/tree/$sha1"

I want to display the hash and URL of head as well, but struggling to figure out which format command should I use. I have tried:

git log -1 --pretty=format:"`git config --get remote.origin.url`/tree/%h"

but it doesn't evaluate the git config --get remote.origin.url part and instead prints it verbatim. Can we someone format with nested command? Or is there any other git command which can produce the desired output (origin.url + "/tree/" + "sha1")?

It would be much appreciated if the solution is one liner with single, pure git command executing the nested command as I need to run it on a slim Windows build environment, where python, ruby and bash etc. commands (like cut etc.) are note available.

0

There are 0 best solutions below