You can use the --format argument with a custom format that only includes the sha1:
git log --format=format:%H
The above command yields output like the following:
0375602ba2017ba8750a58e934b41153faee6fcb
4390ee9f4428c84bdbeb2fed0a461099a6c81b39
bff53bfbc56485c4c1007b0884bb1c0d61a1cf71
You can loop over the commit hashes in Bash like this:
for sha1 in $(git log --format=format:%H); do
: # Do something with $sha1
done
This is slightly more verbose than using git rev-list, but may be your only option if you want to use ordering or filtering arguments for git log that are not supported by git rev-list, like -S.