Created
January 26, 2026 12:36
-
-
Save disouzam/68d1daf6574bb8fd425d0a7ad8c35570 to your computer and use it in GitHub Desktop.
Get git short log, diff stats and diff patches with a single command
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| function get_short_log() { | |
| sanitized_commits=$(sed 's/\.\././g' <<< "$1") | |
| commit1=$(echo "$sanitized_commits" | cut -d '.' -f 1) | |
| commit2=$(echo "$sanitized_commits" | cut -d '.' -f 2) | |
| echo -e "==============================" | |
| echo -e "Short log between $commit1 and $commit2:\n" | |
| git shortlog --group=author $commit1..$commit2 | |
| echo -e "\n==============================" | |
| echo -e "Diff stats between $commit1 and $commit2:\n" | |
| git diff --stat $commit1..$commit2 | |
| echo -e "\n==============================" | |
| echo -e "Diff patches between $commit1 and $commit2:\n" | |
| git diff $commit1..$commit2 | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to use it
get_short_log {commit hash1}..{commit hash2}Example using https://github.com/disouzam/expo-and-react-native-tutorial: