Commit Graph

368 Commits

Author SHA1 Message Date
Douwe Maan 29d574868a Display new diff notes and allow creation through the web interface 2016-07-06 18:51:00 -04:00
Douwe Maan db65954d78 Add Gitlab::Git::PositionTracer 2016-07-06 18:50:59 -04:00
Douwe Maan e9e06ca627 Add Gitlab::Diff::LineMapper 2016-07-06 18:50:59 -04:00
Douwe Maan 9abcc0a98f Add Gitlab::Git::Position 2016-07-06 18:50:59 -04:00
Douwe Maan a27462a5c6 Extract parts of LegacyDiffNote into DiffOnNote concern and move part of responsibility to other classes 2016-07-06 18:50:59 -04:00
Douwe Maan 375193455a Style diff and blob file headers the same way 2016-07-06 18:50:59 -04:00
Douwe Maan 9fc0e11e0d Add DiffFile#blob and #old_blob 2016-07-06 18:50:58 -04:00
Douwe Maan a9fa45f09e Represent DiffRefs as proper class instead of tuple array 2016-07-06 18:50:58 -04:00
Grzegorz Bizon 9e211091a8 Enable Style/EmptyLines cop, remove redundant ones 2016-07-01 21:56:17 +02:00
Felipe Artur 56f3b243ce Add leading comment space cop 2016-05-31 19:33:46 -03:00
Rémy Coutable 5341b16fc9
Reuse existing SCSS variables
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-05-18 13:20:46 -05:00
Adam Butler 8a8b5497c5 Create DiffFilter and change SystemNoteService#change_title to use Gitlab::Diff::InlineDiff 2016-05-18 11:15:10 -05:00
Connor Shea 4995302df6
Enable the StringReplacement cop.
Also fix one use of `gsub` that would be faster as `delete`.

Use `tr` instead of `gsub` when you are replacing the same number of
characters. Use `delete` instead of `gsub` when you are deleting
characters.
2016-05-10 18:34:15 -06:00
Yorick Peterse 3f0d780c19 Show a notice for diffs that are too large
This builds on the changes introduced in
https://gitlab.com/gitlab-org/gitlab_git/merge_requests/72 and results
in merge requests with large diffs (e.g. due to them containing minified
CSS) loading much faster.
2016-03-18 12:30:46 +01:00
Rubén Dávila 7e03b40221 Return an empty Array when there aren't lines to parse. 2016-03-15 19:51:27 -05:00
Jacob Vosmaer 1764e1b7cb Use Gitlab::Git::DiffCollections 2016-03-03 18:38:44 +01:00
Douwe Maan 677b4db9e6 Mark inline difference between old and new paths when a file is renamed 2016-01-29 19:37:17 +01:00
Robert Speicher 2fed8bf390 Merge branch 'fix-diff-comments' into 'master'
More highlighted diff fixes

See merge request !2545
2016-01-22 07:37:47 +00:00
Douwe Maan 3db24ec9e8 Properly highlight right side of parallel diff 2016-01-22 02:12:43 +01:00
Douwe Maan 16d17b78ca Restore diff comments 2016-01-22 02:10:58 +01:00
Douwe Maan 82d0fa8e45 Fix 2016-01-22 01:53:01 +01:00
Douwe Maan 150b4f66e6 Make sure non-highlighted diffs are still escaped 2016-01-22 01:47:17 +01:00
Douwe Maan 6000f8545f Validate bounds just to be sure 2016-01-20 19:33:34 +01:00
Douwe Maan 0e992a3b4e Properly highlight lines around '\ No newline at end of file' 2016-01-20 19:20:13 +01:00
Douwe Maan 577f2fb47a Save and use actual diff base commit for MR diff highlighting 2016-01-20 18:44:27 +01:00
Douwe Maan a010db5db2 Properly handle HTML entities with inline diffs 2016-01-20 15:26:44 +01:00
Douwe Maan 701513dcc7 Move parallel diff logic to separate class 2016-01-20 14:53:20 +01:00
Douwe Maan 0a8039eb77 Remove useless assignments 2016-01-19 13:56:36 +01:00
Douwe Maan 12546f895f Add tests 2016-01-15 16:29:26 +01:00
Douwe Maan 5de8971ddf Whoops, forgot to add files 2016-01-15 16:02:48 +01:00
Douwe Maan 13f10efcf1 Move inline diff marker logic to its own class 2016-01-15 14:39:43 +01:00
Douwe Maan 7d31f37219 Move inline diff logic to its own class 2016-01-15 14:25:29 +01:00
Douwe Maan 71b4341a37 Method was moved 2016-01-15 14:11:36 +01:00
Rubén Dávila c8db25c37c Merge branch 'master' into issue_3945 2016-01-14 17:28:44 -05:00
Rubén Dávila 6b9c730e91 More refactoring from last code review. #3945
* Use commit objects instead of IDs when generating diffs
* Use proper references when generating MR's source and target
* Update broken specs
2016-01-14 16:47:55 -05:00
Douwe Maan 8dfad143d4 Add inline diff markers in highlighted diffs. 2016-01-14 22:28:07 +01:00
Douwe Maan 83e4fc188b Refactor highlighting lines 2016-01-14 16:13:35 +01:00
Douwe Maan 3a1d053599 Remove duplication around highlighting. 2016-01-14 15:11:50 +01:00
Douwe Maan 05187f0fc6 Properly generate diff of orphan commits, like the first commit in a repository 2016-01-14 13:09:36 +01:00
Rubén Dávila c179b48c97 Use #sub instead of #gsub!. #3945
* This is because is not a good idea to modify the original lines
* Also I run into this issue https://gitlab.com/gitlab-org/gitlab_git/issues/14
  which is returning Diff Lines with the same @new_pos value.
2016-01-13 21:04:53 -05:00
Rubén Dávila 0f0af19139 Little refactor for usage of html_safe. #3945 2016-01-13 11:39:15 -05:00
Rubén Dávila 7307fa48e7 Fix broken specs. #3945 2016-01-12 19:28:31 -05:00
Rubén Dávila 6e3358a507 Remove no longer required code. #3945 2016-01-12 17:36:08 -05:00
Rubén Dávila f1f9b5f7d3 Small fixes from code review. #3945 2016-01-12 12:53:54 -05:00
Rubén Dávila fed10766e5 Fix broken spec for submodule commit. #3945 2016-01-09 01:55:31 -05:00
Rubén Dávila 78d7c0e0d8 Fix broken specs. #3945 2016-01-08 19:05:55 -05:00
Rubén Dávila 6282202ee8 Remove custom Lexer. #3945 [ci skip]
Inline diff is going to be generated client side now. #3945
2016-01-08 15:20:48 -05:00
Rubén Dávila 21b602c60a Change strategy to highlight diffs. #3945
Now we apply syntax highlighting to the whole old and new files.
This basically help us to highlight adequately multiline content.
2016-01-07 22:37:01 -05:00
Rubén Dávila f1f4fdf778 Don't process inline diffs on backend. #3945 2016-01-07 21:08:57 -05:00
Rubén Dávila 3fbcf52ec8 Apply syntax highlighting when expanding diff plus some refactor. #3945 2015-12-31 01:05:52 -05:00
Rubén Dávila fd100e1ef1 Don't modify "match" diff lines. #3945 2015-12-30 21:44:12 -05:00
Rubén Dávila 8b079315d9 A bit of refactoring. #3945 2015-12-30 21:23:50 -05:00
Rubén Dávila 7de90f4b53 Fix broken spec and small refactor. #3945 2015-12-30 18:42:11 -05:00
Rubén Dávila b74f36c9ca Fix Rubocop complain. #3945 2015-12-30 13:10:28 -05:00
Rubén Dávila bb96d63153 New implementation for highlighting diff files. #3945
* It is more performant given now we process all the diff file instead
  of processing line by line.
* Multiline comments are highlighted correctly.
2015-12-30 00:52:50 -05:00
Gabriel Mazetto b5291f9599 Fixed Rubocop offenses 2015-12-15 00:53:52 -02:00
Guilherme Garnier 59d0263bc8 Fix rubocop warnings in lib 2015-10-03 01:29:58 -05:00
Dmitriy Zaporozhets 0d967bce57
Show additions/deletions stats on merge request diff
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-10-01 13:52:08 +02:00
Douwe Maan 0632e85c82 Fix commit comments on first line of diff not rendering in Merge Request Discussion view. 2015-02-20 10:23:34 +01:00
Dmitriy Zaporozhets 61cc6a9244 Rubocop: indentation fixes Yay!!! 2015-02-02 21:59:28 -08:00
Dmitriy Zaporozhets c427bf08e4 Rubocop: Style/AlignArray enabled 2015-02-02 20:58:28 -08:00
Ciro Santilli 2e9f5de868 Add parenthesis to function def with arguments. 2014-10-03 09:18:46 +02:00
Dmitriy Zaporozhets b13c1469a3
Rollback diff drop and set default commit id to HEAD
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-09-25 12:46:30 +03:00
Dmitriy Zaporozhets 13aec95264 Improve diff and bump gitlab_git revision 2014-09-24 15:59:57 +03:00
Dmitriy Zaporozhets 53f2130e63 Use new version of gitlab_git with extended rugged usage 2014-09-24 13:26:53 +03:00
Dmitriy Zaporozhets 218219abbd
Refactoring inside refactoring. We need to go deeper
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-09-08 21:54:52 +03:00
Dmitriy Zaporozhets bde3f25d26
Specs for diff parser! Yay!
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-09-08 20:42:12 +03:00
Dmitriy Zaporozhets 4ef809c77d
Gitlab::Diff classes added
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-09-08 16:25:50 +03:00