tj / tj/git-extras

feat: `diff-log`

Open
#1,243 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Shell
Stars
18.1k
Forks
1.2k
Avg merge
5d 17h
Merged PRs (30d)
1

Description

It shows the diff between 2 logs (with --patch by default), something like:

git diff --no-index <(git log -p --format=%s a) <(git log -p --format=%s b)

This is really useful to verify a rebase (or anything that rewrites history). Especially useful if an interactive rebase doesn't change the final state of a branch (as usual of squash).

An alias is not enough, as there's cases when the user may need to pass extra flags, such as:

  • -n3/-3 to limit the output of the logs. There's cases when each log needs an independent n value, so simply repeating the same -n twice is not enough.
  • --color-words, to make diff smaller.
  • --color-moved{,-ws}. Especially ws, because of its many values.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the existing git-extras command entry points and inspect how commands parse arguments and invoke Git. Define the diff-log command around two log inputs, with patch output by default and support for independent log limits plus the listed diff flags. Done means it can compare rewritten histories and pass those options through as described.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, shell
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
54/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.