git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Jakub Narebski <jnareb@gmail.com>
Date
Oct 30, 2011, 23:36 UTC
Message-ID
<1320017787-18048-1-git-send-email-jnareb@gmail.com>
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(-)
-- 
1.7.6
Next: Jakub Narebski
Message 1 of 9 in “[PATCHv3 0/8] gitweb: side-by-side diff”
  1. Jakub NarebskiOct 30, 2011
  2. 1/8 gitweb: Refactor diff body line classificationJakub Narebski, Oct 30, 2011
  3. 2/8 gitweb: Extract formatting of diff chunk headerJakub Narebski, Oct 30, 2011
  4. 3/8 gitweb: Add a feature to show side-by-side diffJakub Narebski, Oct 30, 2011
  5. 4/8 gitweb: Give side-by-side diff extra CSS stylingJakub Narebski, Oct 30, 2011
  6. 5/8 t9500: Add test for handling incomplete lines in diff by gitwebJakub Narebski, Oct 30, 2011
  7. 6/8 t9500: Add basic sanity tests for side-by-side diff in gitwebJakub Narebski, Oct 30, 2011
  8. 7/8 gitweb: Use href(-replay=>1,...) for formats links in "commitdiff"Jakub Narebski, Oct 30, 2011
  9. 8/8 gitweb: Add navigation to select side-by-side diffJakub Narebski, Oct 30, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.