Skip to content

gitweb: side-by-side diff

Jakub Narebski git 2 versions New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest8 patches 0 repliesNew
  2. v11 patch 0 repliesSuperseded

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8gitweb: Refactor diff body line classificationgitweb/gitweb.perl+37 -300 replies
2/8gitweb: Extract formatting of diff chunk headergitweb/gitweb.perl+67 -470 replies
3/8gitweb: Add a feature to show side-by-side diffgitweb/gitweb.perl gitweb/static/gitweb.css+122 -110 replies
4/8gitweb: Give side-by-side diff extra CSS stylinggitweb/gitweb.perl gitweb/static/gitweb.css+42 -100 replies
5/8t9500: Add test for handling incomplete lines in diff by gitwebt/t9500-gitweb-standalone-no-errors.sh+47 -00 replies
6/8t9500: Add basic sanity tests for side-by-side diff in gitwebt/t9500-gitweb-standalone-no-errors.sh+25 -10 replies
7/8gitweb: Use href(-replay=>1,...) for formats links in "commitdiff"gitweb/gitweb.perl+8 -80 replies
8/8gitweb: Add navigation to select side-by-side diffgitweb/gitweb.perl+23 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.

Read the v3 thread

Cover letter [PATCHv3 0/8] gitweb: side-by-side diff

NOTE: As it is feature-freeze period, this patch series is for review.

This is refinement and extension of Kato Kazuyoshi patch series, sent originally as

[PATCH/RFC] gitweb: add the ability to show side-by-side diff on commitdiff.
http://thread.gmane.org/gmane.comp.version-control.git/183744

and then refined and split into two-patch series

[PATCH/RFC 1/2] gitweb: change format_diff_line() to remove leading SP from $diff_class
http://thread.gmane.org/gmane.comp.version-control.git/183770

[PATCH 2/2] gitweb: add a feature to show side-by-side diff
http://thread.gmane.org/gmane.comp.version-control.git/183769

This patch series originally started as rebasing second patch in above two part series on top of diff line classification refactoring suggested by me and proposed by Junio. Then I thought about putting all code printing side-by-side diff in print_sidebyside_diff_chunk() subroutine, then...

Main changes from v2 version from Kato Kazuyoshi:

* Built on top of refactoring of code related to diff output formatting (patches 1 and 2)

* Code reworked so that is in my opinion easier to follow; gitweb now handles merges and diffs with incomplete lines correctly (patch 3)
- well, it handles merges by turning off side-by-side diff for them.

* Adding background color to distinguish empty context lines from vertical align, similarly to e.g.
http://community.activestate.com/files/images/sbsdiffs.png
but without refinement (word diff of changes).

* Adds some very basic test for side-by-side diff (patch 6 (and 5))

* Split adding navigation into a separate commit, and uses [nav] links rather than HTML form for selecting between inline and side-by-side diff style (diff 8). Thanks to more thorough use of href(-replay=>1,..) (patch 7) style of diff should be preserved with this series.

Please excuse me for essentially hijacking this patch series.

P.S. I really, really need to finish work on splitting gitweb into smaller pieces. With around 8,000 lines it becomes quite unwieldy. But this would probably need total rework of error handling (the die_error subroutine), and that would need another changes, etc....

Pull request:
~~~~~~~~~~~~~
These changes are available in the git repository(-y/+ies) at:
git://repo.or.cz/git/jnareb-git.git gitweb/side-by-side-diff-v4
git://github.com/jnareb/git gitweb/side-by-side-diff-v4

Table of contents:
~~~~~~~~~~~~~~~~~~
[PATCHv3 1/8] gitweb: Refactor diff body line classification [PATCHv3 2/8] gitweb: Extract formatting of diff chunk header [PATCHv3 3/8] gitweb: Add a feature to show side-by-side diff [PATCHv3 4/8] gitweb: Give side-by-side diff extra CSS styling [PATCHv3 5/8] t9500: Add test for handling incomplete lines in diff
by gitweb
[PATCHv3 6/8] t9500: Add basic sanity tests for side-by-side diff in
gitweb
[PATCHv3 7/8] gitweb: Use href(-replay=>1,...) for formats links in
"commitdiff"
[PATCHv3 8/8] gitweb: Add navigation to select side-by-side diff

Shortlog:
~~~~~~~~~
Jakub Narebski (6):
gitweb: Refactor diff body line classification
gitweb: Extract formatting of diff chunk header
gitweb: Give side-by-side diff extra CSS styling
t9500: Add test for handling incomplete lines in diff by gitweb
t9500: Add basic sanity tests for side-by-side diff in gitweb
gitweb: Use href(-replay=>1,...) for formats links in "commitdiff"

Kato Kazuyoshi (2):
gitweb: Add a feature to show side-by-side diff
gitweb: Add navigation to select side-by-side diff

Diffstat:
~~~~~~~~~

 gitweb/gitweb.perl                     |  339 +++++++++++++++++++++++--------
 gitweb/static/gitweb.css               |   30 +++
 t/t9500-gitweb-standalone-no-errors.sh |   73 +++++++-
 3 files changed, 353 insertions(+), 89 deletions(-)
Signature · 1 line
1.7.6