tip to review a large patch with magit and ediff

When reviewing a large changeset with magit, it can be difficult to separate meaningfull changes from purely syntactic substitutions. Using ediff to navigate the patch highlights the words changed between two lines instead of just showing a line removed and another added.

In the above screenshot the oid change to oid.hobj is a syntactic change where the new block after oid.generation != ghobject_t::NO_GEN deserves more attention.

Browsing the changeset 8117d14f21d66613d5ee19644cef00f7e4d25b30 from the magit-status buffer shows a lot of files. Quickly browsing the patch shows hundreds of trivial changes.

They are difficult to distinguish from those that won’t be caught by the compiler and deserve more attention. By typing e the display switches to ediff and colorizes the changed words.

If the blue zone does not span more than one word, type n to move to the next hunk. Otherwise stop to review.

This entry was posted in emacs, git, magit. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>