Welcome to the Power Users community on Codidact!
Power Users is a Q&A site for questions about the usage of computer software and hardware. We are still a small site and would like to grow, so please consider joining our community. We are looking forward to your questions and answers; they are the building blocks of a repository of knowledge we are building together.
Post History
Include diffs in the log I would like to easily review commits in that date range […] I know that from the command line I can use git log with --since and --until options, but that just gets me...
#1: Initial revision
## Include diffs in the log > I would like to easily review commits in that date range […] > > I know that from the command line I can use `git log` with `--since` and `--until` options, but that just gets me a log -- a list of commit hashes and messages -- on my local machine. In order to see what happened, I have to jump through some extra hoops […] If "review" just means "look at," you can add the `-p` (`--patch`) flag to your `git log` command to include the diff of the files each commit affected. ## Arbitrary log formats But since the ellipses I dropped are about other team members, I imagine "review" means "annotate with comments on the upstream remote." You can format `git log` [pretty freely][pretty-format]. If your terminal supports clickable links, you could do something like this: ```sh git log --since=foo --until=bar --format=tformat:'%Cred%s%Creset%nhttps://github.com/codidact/qpixel/commit/%H' ``` Favorite log formats can easily be aliased to presets, and you can always throw additional non-conflicting `git log` arguments like `--since`, `--until`, or `-p` into the CLI when calling your preset. For example: ```ini [alias] # Pretty logs lg-links = log ---format=tformat:'%Cred%s%Creset%nhttps://github.com/codidact/qpixel/commit/%H' ``` ```sh git lg-links --since=2023-10-01 --until=2023-10-04 --graph ``` ## Just use GitHub As [Moshi points out][moshi], GitHub has some filtering options for its log pages, even if there aren't links to them. <pre><code><a href="https://github.com/codidact/qpixel/commits/develop?since=2023-10-01&until=2023-10-04">https://github.com/codidact/qpixel/commits/develop?since=2023-10-01&until=2023-10-04</a></code></pre> [^lg]: For instance, I have `git lg` aliased to `log --graph --date=auto:human --format=tformat:'%C(bold yellow)%h%C(reset) %C(green)%ad%C(reset) %s %C(dim white)%aN%C(reset) %w(0,0,9)%C(auto)%+d%C(reset)'` and `git lg2` to `log --graph --format=tformat:'%C(bold yellow)%h%C(reset) %C(cyan)%aD%C(reset) %C(green)(%ar) %C(dim white)%aN%C(reset)%w(0,0,9)%n %C(brightwhite)%s%C(auto)%+d%C(reset)%w(0,0,10)%+b'` [pretty-format]: https://git-scm.com/docs/pretty-formats [moshi]: https://powerusers.codidact.com/comments/thread/8706
