I know that this type of questions is addressed in a lot of Q/A, I have studied them but actually I did not found a way to get the what I want.
I am looking for the git logs between two hashes including the logs of hashes used in the range.
From looking to the docs and other Q/A in SO I have found that it is achievable this way:
git log oldest...Newest
But this does not return the log of oldest is excluded.
For example in this repo https://github.com/galniv/jira-git-helper/commits/master
I want the logs between 52209d3738f80e49c724502503d6a72c1e24e6bc
as the oldest and 5456f8cecc5ef5cef5abc1f820a4f044e2153734
as the newest.
The result of git log 52209d3738f80e49c724502503d6a72c1e24e6bc...5456f8cecc5ef5cef5abc1f820a4f044e2153734
returns only two logs instead of 3 :
commit 5456f8cecc5ef5cef5abc1f820a4f044e2153734
Author: Gal Niv <[email protected]>
Date: Tue Mar 21 15:33:55 2017 -0400
Update README.md
commit a4c184ecc7fb4c50705c0ac90c94752a31ce7251
Author: Gal Niv <[email protected]>
Date: Tue Mar 21 11:48:30 2017 -0400
Remove console.log, display current branch name
How to include the log of the oldest hash?
A simple fix is to pass the --pretty=oneline parameter, which makes it all fit on a single line. It's taking up less space, but missing crucial information like the date of the commit. There are longer versions of that same --pretty parameter. In fact, it allows you to specify all the fields you want in the output.
By Amount. The most basic filtering option for git log is to limit the number of commits that are displayed. When you're only interested in the last few commits, this saves you the trouble of viewing all the commits in a page. You can limit git log 's output by including the - option.
So "revision" refers to the id you can use as a parameter to reference an object in git (usually a commit). HEAD@{5 minutes ago} is a revision which reference the commit present 5 minutes ago.
If there's no merge-commit involved, I'd use the ~:
git log old-rev~1..new-rev
That should be enough.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With