Exclude Preceding Commit> line from git rev-list formatting

git

Solution

To leave an answer for those who will come next/

@torec mentioned in his comment the following:

`git rev-list` and `git log` are essentially the same command

The answer is to use the following format:

# print out the log history in the desired format.
git log --pretty="format:..." <SHA-1>

Problem

I'm trying to work on a branch diff command, and I've got it all working... Except for the formatting. I can use `--pretty=oneline` to display just the information I want, except it displays the full hash, and doesn't colorize the output. So it'd just output this: ``` fa73c05913292fbce940075fc8f454bad5066666 Example Commit Message de4dbeffa249393dddebb7b13ae555cb97cad5be Another Example Commit Message ``` If I try and do a custom format string, such as this: `--pretty="format:%C(yellow)%h%C(reset) %s"`, it works, but it also displays an additional line above it. E.g. ``` commit >fa73c05913292fbce940075fc8f454bad5066666 fa73c05 Example Commit Message commit >de4dbeffa249393dddebb7b13ae555cb97cad5be de4dbef Another Example Commit Message ``` Is there a way to have `git rev-list` output a format without the preceding `commit >abcdef3...` lines?

Original source