gitgitweb

"Pull request"-like diff view with gitweb


I'm using gitweb, and I'd like to view a combined diff of a range of commits (e.g. all commits that exist on a branch, but not master). Basically I'm looking for a poor man's GitHub pull-request diff view.

The closest I've found is modifying the gitweb URL to list the commits individually that exist on the branch but not master.

http://GITWEB/REPOSITORY.git/shortlog/master..BRANCH

Which is helpful, but I also want to see a combined diff view like GitHub does.

Is it possible?


Solution

  • Ok I found a reasonably good solution. This is not exposed in the UI, but you can manually provide a range in the commitdiff action URL instead of just a single commit reference. e.g.

    http://GITWEB/REPOSITORY.git/commitdiff/master..BRANCH

    The combined diff looks great. One caveat is that the view prints the commit message for the commit at the HEAD of the branch at the top which doesn't seem useful for a combined diff (if inclined to fix, see source code).