So, the following bash oneliner will generate similar output as git log
git rev-list --reverse HEAD | while read rev; do git log -1 $rev; done
What I want to know is, what is the purpose of read rev in this context? Is there another way this could be written without read rev perhapse with xargs?
Yes you can use xargs in this case:
To explain how
read revworks here, the loop reads one line from its input (in this case, from the output of thegit rev-list --reverse HEADcommand) and stores it in the variablerev. Then, any commands within the loop can use the variablerev. As an example:will show