Commit 6ba1eb5
gitweb: Add a feature to show side-by-side diff
This commits adds to support for showing "side-by-side" style diff.
Currently you have to hand-craft the URL; navigation for selecting
diff style is to be added in the next commit.
The diff output in unified format from "git diff-tree" is reorganized to
side-by-side style chunk by chunk with format_sidebyside_diff_chunk().
This reorganization requires knowledge about diff line classification,
so format_diff_line() was renamed to process_diff_line(), and changed to
return tuple (list) consisting of class of diff line and of
HTML-formatted (but not wrapped in <div class="diff ...">...</div>) diff
line. Wrapping is now done by caller, i.e. git_patchset_body().
Gitweb uses float+margin CSS-based layout for "side by side" diff.
You can specify style of diff with "ds" ('diff_style') query
parameter. Currently supported values are 'inline' and 'sidebyside';
the default is 'inline'.
Another solution would be to use "opt" ('extra_options') for that...
though current use of it in gitweb seems to suggest that "opt" is more
about passing extra options to underlying git commands, and "git diff"
doesn't support '--side-by-side' like GNU diff does, (yet?).
Signed-off-by: Kato Kazuyoshi <kato.kazuyoshi@gmail.com>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent f1310cf commit 6ba1eb5
2 files changed
Lines changed: 122 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
759 | 759 | | |
760 | 760 | | |
761 | 761 | | |
| 762 | + | |
762 | 763 | | |
763 | 764 | | |
764 | 765 | | |
| |||
2317 | 2318 | | |
2318 | 2319 | | |
2319 | 2320 | | |
2320 | | - | |
2321 | | - | |
| 2321 | + | |
| 2322 | + | |
| 2323 | + | |
2322 | 2324 | | |
2323 | 2325 | | |
2324 | 2326 | | |
2325 | 2327 | | |
2326 | | - | |
2327 | | - | |
2328 | 2328 | | |
2329 | 2329 | | |
2330 | 2330 | | |
2331 | 2331 | | |
2332 | 2332 | | |
2333 | 2333 | | |
2334 | | - | |
| 2334 | + | |
2335 | 2335 | | |
2336 | 2336 | | |
2337 | 2337 | | |
2338 | | - | |
| 2338 | + | |
2339 | 2339 | | |
2340 | 2340 | | |
2341 | | - | |
| 2341 | + | |
2342 | 2342 | | |
2343 | 2343 | | |
2344 | 2344 | | |
| |||
4860 | 4860 | | |
4861 | 4861 | | |
4862 | 4862 | | |
| 4863 | + | |
| 4864 | + | |
| 4865 | + | |
| 4866 | + | |
| 4867 | + | |
| 4868 | + | |
| 4869 | + | |
| 4870 | + | |
| 4871 | + | |
| 4872 | + | |
| 4873 | + | |
| 4874 | + | |
| 4875 | + | |
| 4876 | + | |
| 4877 | + | |
| 4878 | + | |
| 4879 | + | |
| 4880 | + | |
| 4881 | + | |
| 4882 | + | |
| 4883 | + | |
| 4884 | + | |
| 4885 | + | |
| 4886 | + | |
| 4887 | + | |
| 4888 | + | |
| 4889 | + | |
| 4890 | + | |
| 4891 | + | |
| 4892 | + | |
| 4893 | + | |
| 4894 | + | |
| 4895 | + | |
| 4896 | + | |
| 4897 | + | |
| 4898 | + | |
| 4899 | + | |
| 4900 | + | |
| 4901 | + | |
| 4902 | + | |
| 4903 | + | |
| 4904 | + | |
| 4905 | + | |
| 4906 | + | |
| 4907 | + | |
| 4908 | + | |
| 4909 | + | |
| 4910 | + | |
| 4911 | + | |
| 4912 | + | |
| 4913 | + | |
| 4914 | + | |
| 4915 | + | |
| 4916 | + | |
| 4917 | + | |
| 4918 | + | |
| 4919 | + | |
| 4920 | + | |
| 4921 | + | |
| 4922 | + | |
| 4923 | + | |
| 4924 | + | |
| 4925 | + | |
| 4926 | + | |
| 4927 | + | |
| 4928 | + | |
| 4929 | + | |
| 4930 | + | |
| 4931 | + | |
| 4932 | + | |
4863 | 4933 | | |
4864 | | - | |
| 4934 | + | |
4865 | 4935 | | |
4866 | 4936 | | |
4867 | 4937 | | |
| |||
4871 | 4941 | | |
4872 | 4942 | | |
4873 | 4943 | | |
| 4944 | + | |
4874 | 4945 | | |
4875 | 4946 | | |
4876 | 4947 | | |
| |||
4977 | 5048 | | |
4978 | 5049 | | |
4979 | 5050 | | |
4980 | | - | |
| 5051 | + | |
| 5052 | + | |
| 5053 | + | |
| 5054 | + | |
| 5055 | + | |
| 5056 | + | |
| 5057 | + | |
| 5058 | + | |
| 5059 | + | |
| 5060 | + | |
| 5061 | + | |
| 5062 | + | |
| 5063 | + | |
| 5064 | + | |
| 5065 | + | |
| 5066 | + | |
4981 | 5067 | | |
4982 | 5068 | | |
4983 | 5069 | | |
| 5070 | + | |
| 5071 | + | |
| 5072 | + | |
| 5073 | + | |
4984 | 5074 | | |
4985 | 5075 | | |
4986 | 5076 | | |
| |||
6976 | 7066 | | |
6977 | 7067 | | |
6978 | 7068 | | |
| 7069 | + | |
6979 | 7070 | | |
6980 | 7071 | | |
6981 | 7072 | | |
| |||
7085 | 7176 | | |
7086 | 7177 | | |
7087 | 7178 | | |
7088 | | - | |
| 7179 | + | |
| 7180 | + | |
7089 | 7181 | | |
7090 | 7182 | | |
7091 | 7183 | | |
| |||
7113 | 7205 | | |
7114 | 7206 | | |
7115 | 7207 | | |
| 7208 | + | |
7116 | 7209 | | |
7117 | 7210 | | |
7118 | 7211 | | |
| |||
7316 | 7409 | | |
7317 | 7410 | | |
7318 | 7411 | | |
7319 | | - | |
| 7412 | + | |
| 7413 | + | |
7320 | 7414 | | |
7321 | 7415 | | |
7322 | 7416 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
475 | 475 | | |
476 | 476 | | |
477 | 477 | | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
478 | 495 | | |
479 | 496 | | |
480 | 497 | | |
| |||
0 commit comments