Commit Graph

291 Commits

Author SHA1 Message Date
Andrew Newdigate a89f18bf2c Renamed Gitaly services 2017-07-18 07:59:36 +00:00
Lin Jen-Shin aada5273fa Use RequestStoreWrap for Commit#author
We also try to use instance variable to cache the result if
RequestStore is not available, so we could keep the same logic,
using the same cache key. Also introduce a way to specify method
specific cache key
2017-07-18 01:18:20 +08:00
Sean McGivern aff5c9f3e5 Add table for merge request commits
This is an ID-less table with just three columns: an association to the merge
request diff the commit belongs to, the relative order of the commit within the
merge request diff, and the commit SHA itself.

Previously we stored much more information about the commits, so that we could
display them even when they were deleted from the repo. Since 8.0, we ensure
that those commits are kept around for as long as the target repo itself is, so
we don't need to duplicate that data in the database.
2017-07-06 17:36:10 +01:00
Dmitriy Zaporozhets 8ce11fc388 Merge branch '12614-fix-long-message' into 'master'
Fix long urls in the title of commit

Closes #12614

See merge request !10938
2017-06-08 10:32:45 +00:00
Ahmad Sherif 204db05637 Re-enable Gitaly commit_raw_diffs migration 2017-06-07 16:55:45 +02:00
Robert Speicher 993412f9de Merge branch 'fix/use-new-gitaly-commit-diff-rpc' into 'master'
Use the new Gitaly CommitDiff RPC

See merge request !11826
2017-06-02 19:39:02 +00:00
Robert Speicher 3cdac884c7 Merge branch 'rc/enable-PreferredHashMethods-cop' into 'master'
Enable the Style/PreferredHashMethods cop

See merge request !11883
2017-06-02 19:00:28 +00:00
Rémy Coutable 4cfa5ce4a9
Enable the Style/PreferredHashMethods cop
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-06-02 19:11:26 +02:00
Rémy Coutable 857d039145
Lint our factories creation in addition to their build
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-06-02 19:06:50 +02:00
Ahmad Sherif 4d1e987ec3 Use the new Gitaly CommitDiff RPC 2017-06-02 18:33:18 +02:00
Ahmad Sherif 99feed6e00 Add support for deltas_only under Gitaly
Closes gitaly#199
2017-05-13 18:27:06 +02:00
Alexander Randa fdba744986 Fix long urls in the title of commit 2017-05-12 11:45:26 +00:00
Jacob Vosmaer 27fb64d6a3 Remove deltas_only from DiffCollection 2017-05-11 16:01:10 +02:00
Rémy Coutable d40e1f547e Enable the Style/TrailingCommaInLiteral cop
Use the EnforcedStyleForMultiline: no_comma option.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-05-10 18:25:45 +02:00
Jacob Vosmaer 3107f2e460 Use Rails 'delegate' 2017-05-09 14:44:15 +02:00
Jacob Vosmaer f1a14d6857 Don't make Commit#raw_deltas private 2017-05-09 13:48:21 +02:00
Jacob Vosmaer 48254d187f Don't use DiffCollection for deltas 2017-05-09 12:27:17 +02:00
Ahmad Sherif 34cd109797 Re-enable Gitaly commit_raw_diff feature 2017-05-07 23:37:42 +02:00
Lin Jen-Shin 0a29bde4a1 Rename latest_pipeline to last_pipeline
As it might be confusing that it's not the same as
Pipeline#latest

Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/11038#note_28677090
2017-05-03 01:40:49 +08:00
Lin Jen-Shin e69a7b95df Always show latest pipeline info in commit box 2017-05-03 00:17:53 +08:00
Douwe Maan 7f625f06d3 Pass project to Blob 2017-04-27 12:23:26 -05:00
Alejandro Rodríguez d6cc8feb6c Setup and run a Gitaly server for testing if GitalyClient is enabled 2017-04-11 16:00:44 -03:00
Douwe Maan 08bbb9fce6
Add option to start a new discussion on an MR 2017-04-05 17:44:14 +01:00
Robert Speicher 5409a3c5b7 Merge branch 'feature/use-gitaly-for-commit-show' into 'master'
Use Gitaly for CommitController#show

See merge request !9629
2017-03-17 17:41:44 +00:00
Filipa Lacerda ec970763e9 Adds pipeline mini-graph to system information box in Commit View 2017-03-16 00:44:31 +00:00
Ahmad Sherif c0a4f527db Use Gitaly for CommitController#show 2017-03-15 12:52:11 +02:00
Douwe Maan bdbc7d967a Revert "Enable Style/BarePercentLiterals"
This reverts commit 96bef54154e669f9a3e92c3a4bc76c0be3a52e48.
2017-02-23 09:32:42 -06:00
Douwe Maan f74ca33a32 Enable Style/ClassCheck 2017-02-23 09:32:22 -06:00
Douwe Maan 5c7f9d69e3 Fix code for cops 2017-02-23 09:31:57 -06:00
Douwe Maan 8a4d68c53e Enable Style/ConditionalAssignment 2017-02-23 09:31:57 -06:00
Douwe Maan 7ea641b6d0 Enable Style/ColonMethodCall 2017-02-23 09:31:57 -06:00
Douwe Maan baafd8de26 Enable Style/BarePercentLiterals 2017-02-23 09:31:57 -06:00
Douwe Maan b7d8df503c Enable Style/MutableConstant 2017-02-23 09:31:56 -06:00
Oswaldo Ferreira 441501e4bf Present TODO's list without grouping by project 2017-01-27 20:20:18 -02:00
YarNayar dd3ddcd72b Allows to search within project by commit's hash
Was proposed in #24833
2017-01-24 14:56:00 +03:00
jurre e59623e738
Mark MR as WIP when pushing WIP commits 2017-01-19 12:30:34 +01:00
P.S.V.R 632d22acf7
Mark Commit persisted
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-01-16 23:28:44 -05:00
James Lopez 112f470572 Fix cross-project references copy to include the project reference
Also added relevant specs and refactored to_references in a bunch of places to be more consistent.
2017-01-03 13:01:46 +01:00
Lin Jen-Shin 7cced60069 Introduce latest_status and add a few tests
Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7333#note_20003268
2016-12-14 23:37:49 +08:00
Lin Jen-Shin 367024f170 Merge remote-tracking branch 'upstream/master' into show-commit-status-from-latest-pipeline
* upstream/master: (557 commits)
  Fix wrong error message expectation in API::Commits spec
  Move admin settings spinach feature to rspec
  Encode when migrating ProcessCommitWorker jobs
  Prevent overflow with vertical scroll when we have space to show content
  Make rubocop happy
  API: Ability to cherry-pick a commit
  Be smarter when finding a sudoed user in API::Helpers
  Backport hooks on group policies for the EE-specific implementation
  API: Ability to get group's project in simple representation
  Add AddLowerPathIndexToRoutes to setup_postgresql.rake
  For single line git commit messages, the close quote should be on the same line as the open quote
  added border-radius and padding to labels
  Allow all alphanumeric characters in file names (!8002)
  Add failing test for #20190
  Don't allow blank MR titles in API
  Replace static fixture for awards_handler_spec (!7661)
  Crontab typo '* */6' -> '0 */6' (4x/day not 1x-per-min-for-1h 4x/day)
  Fix test
  Tweak style and add back wording
  Clean up commit copy to clipboard and make consistent
  ...
2016-12-14 19:24:31 +08:00
Douwe Maan f23b1cb453 Merge branch 'jej-23867-use-mr-finder-instead-of-access-check' into 'security'
Replace MR access checks with use of MergeRequestsFinder

Split from !2024 to partially solve https://gitlab.com/gitlab-org/gitlab-ce/issues/23867

⚠️ - Potentially untested
💣 - No test coverage
🚥 - Test coverage of some sort exists (a test failed when error raised)
🚦 - Test coverage of return value (a test failed when nil used)
 - Permissions check tested

- [x] 💣  app/finders/notes_finder.rb:17
- [x] ⚠️  app/views/layouts/nav/_project.html.haml:80 [`.count`]
- [x] 💣  app/controllers/concerns/creates_commit.rb:84
- [x] 🚥  app/controllers/projects/commits_controller.rb:24
- [x] 🚥  app/controllers/projects/compare_controller.rb:56
- [x] 🚦  app/controllers/projects/discussions_controller.rb:29
- [x]   app/controllers/projects/todos_controller.rb:27
- [x] 🚦  app/models/commit.rb:268
- [x]  lib/gitlab/search_results.rb:71

- [x] https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/2024/diffs#d1c10892daedb4d4dd3d4b12b6d071091eea83df_267_266 Memoize ` merged_merge_request(current_user)`
- [x] https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/2024/diffs#d1c10892daedb4d4dd3d4b12b6d071091eea83df_248_247 Expected side effect for `merged_merge_request!`, consider `skip_authorization: true`.
- [x] https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/2024/diffs#d1c10892daedb4d4dd3d4b12b6d071091eea83df_269_269 Scary use  of unchecked `merged_merge_request?`

See merge request !2033
2016-12-08 21:42:07 -03:00
Oswaldo Ferreira f272ee6eba Add shorthand support to gitlab markdown references 2016-12-02 19:18:17 -02:00
Yorick Peterse 6b4d33566f
Pass commit data to ProcessCommitWorker
By passing commit data to this worker we remove the need for querying
the Git repository for every job. This in turn reduces the time spent
processing each job.

The migration included migrates jobs from the old format to the new
format. For this to work properly it requires downtime as otherwise
workers may start producing errors until they're using a newer version
of the worker code.
2016-12-01 13:36:06 +01:00
Lin Jen-Shin 6192ea53fa Rename latest_for to latest, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7333/diffs#note_18819292
2016-11-24 16:50:37 +08:00
Lin Jen-Shin 721f2d3788 Still use compound pipeline status, but group by
ref and sha so that it would show latest pipeline
if ref and sha are both specified, otherwise still
the same as before.
2016-11-21 22:19:16 +08:00
Lin Jen-Shin 18a71c4760 Show commit status from latest pipeline
Rather than compound status from all pipelines.

Closes #20560
2016-11-08 00:04:18 +08:00
Lin Jen-Shin 0902ba524f Initialize @statuses in status rather than constructor
Feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7034#note_17742312
2016-11-03 23:43:17 +08:00
Lin Jen-Shin 1ae557c106 Merge status_for and status, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7034#note_17742297
2016-11-03 23:39:37 +08:00
Lin Jen-Shin f4b9de38ed It's not used as a public API right now, feedback:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7034#note_17522443
2016-10-28 03:12:12 +08:00
Lin Jen-Shin b4ef158a63 Still show status from pipelines, see:
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7034#note_17397201
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7034#note_17397461
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/6801#note_17468470
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7034#note_17482654
2016-10-27 00:58:40 +08:00
Lin Jen-Shin 5416d0e083 Pass `@ref` along so we know which pipeline to show
Closes #23615
2016-10-24 22:26:06 +08:00
winniehell 0d8352973b Use JavaScript tooltips for mentions (!5301) 2016-09-01 01:21:34 +02:00
Sean McGivern 4a4c1765be Fix line commenting for the initial commit
The initial commit doesn't have a parent, so explicitly pass the blank
SHA and handle that when calculating the position.
2016-08-19 16:35:44 +01:00
Ahmad Sherif a16c26c957 Speed up Commit#repo_changes 2016-08-03 19:23:44 +02:00
Paco Guzman c86c1905b5 switch from diff_file_collection to diffs
So we have raw_diffs too
2016-08-03 07:00:20 +02:00
Paco Guzman 1d0c7b7492 Introduce Compare model in the codebase.
This object will manage Gitlab::Git::Compare instances
2016-08-03 07:00:20 +02:00
Paco Guzman 8f359ea917 Move to Gitlab::Diff::FileCollection
Instead calling diff_collection.count use diff_collection.size which is cache on the diff_collection
2016-08-03 07:00:20 +02:00
Clement Ho e4c517a635 Expand commit message width in repo view 2016-08-02 11:40:44 -05:00
Stan Hu d27e36f35a Add specs for caching commit author 2016-07-27 16:42:38 -07:00
Stan Hu 8a9fc2b67e Cache the commit author in RequestStore to avoid extra lookups in PostReceive
In a PostReceive task with 697 commits (8.9 RC1 -> RC8), looking up
the commit author takes about 10% of the time. Caching this information
in RequestStore saves a few seconds from the overall processing time.

Improves #18663
2016-07-27 15:41:25 -07:00
Rémy Coutable 939436480c Ensure relative paths for video are rewritten as we do for images
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-07-26 10:22:17 +02:00
Douwe Maan a9fa45f09e Represent DiffRefs as proper class instead of tuple array 2016-07-06 18:50:58 -04:00
Alejandro Rodríguez ca696175db Optimize Banzai::Filter::RelativeLinkFilter
A lot of git operations were being repeated, for example, to build a url
    you would ask if the path was a Tree, which would call a recursive routine
    in Gitlab::Git::Tree#where, then ask if the path was a Blob, which would
    call a recursive routine at Gitlab::Git::Blob#find, making reference to
    the same git objects several times. Now we call Rugged::Tree#path, which
    allows us to determine the type of the path in one pass.

    Some other minor improvement added, like saving commonly used references
    instead of calculating them each time.
2016-06-21 10:53:16 -04:00
Alejandro Rodríguez ad83c30855 Remove `projects` inclusion in `notes_with_associations` to skip some unnecessary queries
`notes_with_associations` are used for `participant` declarations, but `Participable`
only really cares about the target entity project, and not the participants
projects.

`notes_with_associations` are also used in `Commit::has_been_reverted?` which
employs the reference extractor of the commit, so no references to the notes
projects are made there (`Mentionable::all_references` cares only about the
`author` and other `attr_mentionable`). A paralel situation occurs on
`Issue::referenced_merge_requests`.
2016-06-08 10:26:05 -04:00
Kamil Trzcinski 021d3810c3 Rename Ci::Commit to Ci::Pipeline and rename some of the ci_commit to pipeline 2016-06-02 16:59:04 +02:00
Yorick Peterse 580d250166
Refactor Participable
There are several changes to this module:

1. The use of an explicit stack in Participable#participants
2. Proc behaviour has been changed
3. Batch permissions checking

== Explicit Stack

Participable#participants no longer uses recursion to process "self" and
all child objects, instead it uses an Array and processes objects in
breadth-first order. This allows us to for example create a single
Gitlab::ReferenceExtractor instance and pass this to any Procs. Re-using
a ReferenceExtractor removes the need for running potentially many SQL
queries every time a Proc is called on a new object.

== Proc Behaviour Changed

Previously a Proc in Participable was expected to return an Array of
User instances. This has been changed and instead it's now expected that
a Proc modifies the Gitlab::ReferenceExtractor passed to it. The return
value of the Proc is ignored.

== Permissions Checking

The method Participable#participants uses
Ability.users_that_can_read_project to check if the returned users have
access to the project of "self" _without_ running multiple SQL queries
for every user.
2016-06-01 16:22:35 +02:00
Kamil Trzciński d240666800 Merge branch 'ci-commit-as-pipeline' into 'master'
Ci::Commit becomes a Pipeline object

1. Ci::Commit receives context: ref, :tag.
1. One Ci::Commit describes a one Pipeline
1. Pipeline is created from `.gitlab-ci.yml`
1. Pipeline is a ordered group of builds
1. We test MR against Pipeline
1. Pipelines have a separate view (https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/3703)
1. Pipeline can be triggered from UI (https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/3703)
1. Later we change `Trigger -> TriggerRequest -> Build` to `Trigger -> Pipeline` (future)
1. We add a Pipeline Hook that will be triggered on Pipeline status change  (future)
1. We extend notifications to use `Pipeline Hook` to send summary on pipeline changes (future)

After merging that I'll prepare a separate MR that will unify naming, database columns, table names:
```
Ci::Commit -> Pipeline
Ci::Build -> Build
CommitStatus -> Job
GenericCommitStatus -> ExternalJob

ci_commits -> pipelines
ci_builds -> jobs
```

This MR implements first 5 points.

This is made to solve this issue https://gitlab.com/gitlab-org/gitlab-ce/issues/14149.

See merge request !3653
2016-04-21 08:10:37 +00:00
Robert Speicher 6a19467c41 Merge branch '15139-fix-constants-redefinition-warnings' into 'master'
Define constants only if not defined yet and freeze them

Fixes #15139.

See merge request !3810
2016-04-19 19:21:50 +00:00
Rémy Coutable 6970612bcc
Get rid of more requires, which causes warnings when code is reloaded
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-04-19 11:48:10 +02:00
Rémy Coutable 2e9f03e514
Define constants only if not defined yet and freeze them
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-04-19 10:37:50 +02:00
P.S.V.R 3d6ba3b107 Add support to cherry-pick any commit
Issue: https://gitlab.com/gitlab-org/gitlab-ce/issues/12785
Merge Request: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/3514
2016-04-18 15:39:07 +08:00
Kamil Trzcinski 065e0c0fe4 Merge remote-tracking branch 'origin/master' into ci-commit-as-pipeline
# Conflicts:
#	db/schema.rb
2016-04-16 19:55:14 +02:00
Rémy Coutable 02cfbf0db5
Refactor and expose only Gitlab::UrlBuilder.build(record)
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-04-13 16:07:04 +02:00
Kamil Trzcinski 4af0968c43 Merge remote-tracking branch 'origin/master' into ci-commit-as-pipeline 2016-04-13 15:47:18 +02:00
Felipe Artur 476cf23fc3 Allow to close invalid merge request 2016-04-11 19:00:59 -03:00
Kamil Trzcinski 5d69f5b46d Use Ci::Commit as Pipeline 2016-04-11 23:32:54 +02:00
Yorick Peterse e7849b0b25 Memoize reference_pattern/link_reference_pattern
These methods are called quite often in loops so by memoizing their
output we can reduce timings a bit.
2016-04-01 11:13:30 +02:00
Rubén Dávila f4a361a2a8 Sanitize commit title when creating revert commit. 2016-03-22 18:01:31 -05:00
Jacob Vosmaer 1764e1b7cb Use Gitlab::Git::DiffCollections 2016-03-03 18:38:44 +01:00
Rémy Coutable 96ed5c5114 Ensure we don't check a commit's description for revert message if it has no description 2016-02-22 18:33:02 +01:00
Rubén Dávila 5ef3f80d41 More updates from the last code review. 2016-02-19 13:15:42 -05:00
Rubén Dávila 28aaef24ad Don't use `self` when looking for cross-references! 2016-02-19 13:14:55 -05:00
Rubén Dávila 169070ba4b Some updates from last code review. 2016-02-19 13:14:54 -05:00
Rubén Dávila d34733efc4 Don't show revert button if commit/MR has already been reverted. 2016-02-19 13:14:54 -05:00
Rubén Dávila be54ba33ed Refactor commit message for revert commit. 2016-02-19 13:14:54 -05:00
Rubén Dávila 02f48053f1 No longer need to ignore temporary branch.
* Now it's only created when user choose to create a MR and
  logic to hide it is handled by 50595af7b0/app/helpers/application_helper.rb (L139)
2016-02-19 13:14:53 -05:00
Rubén Dávila f088caca3b Use a reference to the MR when reverting MRs. 2016-02-19 13:14:53 -05:00
Rubén Dávila 328b52d58a Some updates after last code review. 2016-02-19 13:14:52 -05:00
Rubén Dávila a28eef1d1a Update copy and URLs used when reverting MRs. 2016-02-19 13:14:52 -05:00
Rubén Dávila ef591b87d1 Fix commit message plus other little fix. 2016-02-19 13:14:51 -05:00
Rubén Dávila 91e6e32d13 Make it work for merge commits. 2016-02-19 13:14:51 -05:00
Rubén Dávila 8061399368 Add RevertService class with basic logic to revert commit 2016-02-19 13:14:50 -05:00
Robert Speicher d97742570f Increase the minimum length for commit SHA matching to 7
This is the git default and will help to prevent false positive matches.

Closes #12706
2016-01-29 19:52:29 -05:00
Douwe Maan 10387f6b8a Merge branch 'master' into tmp-reference-pipeline-and-caching
# Conflicts:
#	spec/lib/gitlab/markdown/autolink_filter_spec.rb
#	spec/lib/gitlab/markdown/commit_range_reference_filter_spec.rb
#	spec/lib/gitlab/markdown/commit_reference_filter_spec.rb
#	spec/lib/gitlab/markdown/cross_project_reference_spec.rb
#	spec/lib/gitlab/markdown/emoji_filter_spec.rb
#	spec/lib/gitlab/markdown/external_issue_reference_filter_spec.rb
#	spec/lib/gitlab/markdown/external_link_filter_spec.rb
#	spec/lib/gitlab/markdown/issue_reference_filter_spec.rb
#	spec/lib/gitlab/markdown/label_reference_filter_spec.rb
#	spec/lib/gitlab/markdown/merge_request_reference_filter_spec.rb
#	spec/lib/gitlab/markdown/redactor_filter_spec.rb
#	spec/lib/gitlab/markdown/reference_gatherer_filter_spec.rb
#	spec/lib/gitlab/markdown/relative_link_filter_spec.rb
#	spec/lib/gitlab/markdown/sanitization_filter_spec.rb
#	spec/lib/gitlab/markdown/snippet_reference_filter_spec.rb
#	spec/lib/gitlab/markdown/syntax_highlight_filter_spec.rb
#	spec/lib/gitlab/markdown/table_of_contents_filter_spec.rb
#	spec/lib/gitlab/markdown/task_list_filter_spec.rb
#	spec/lib/gitlab/markdown/upload_link_filter_spec.rb
#	spec/lib/gitlab/markdown/user_reference_filter_spec.rb
2015-12-10 14:04:34 +01:00
Rubén Dávila 7e8fc48227 Normalize email when looking for GitLab users from commit info. #3854 2015-12-09 11:10:08 -05:00
Douwe Maan 926c3bef9f Merge branch 'master' into reference-pipeline-and-caching 2015-12-08 13:40:32 +01:00
Valery Sizov bd5fb1b479 Merge branch 'webhook_payload_with_changes' into 'master'
Add added, modified and removed properties to commit object in webhook

https://gitlab.com/gitlab-org/gitlab-ee/issues/20

See merge request !1988
2015-12-07 14:43:13 +00:00
Douwe Maan d611a38798 Merge branch 'master' into reference-pipeline-and-caching 2015-12-07 14:48:53 +01:00
Valery Sizov 3c97cbc74c fixes after review 2015-12-07 15:13:06 +02:00
Valery Sizov 5df2c4419c fox specs 2015-12-07 14:14:35 +02:00
Valery Sizov 5c1b49f494 Add added, modified and removed properties to commit object in webhook 2015-12-04 16:23:21 +02:00
Douwe Maan f3ea06eb7f Autolink first so we don't pick up numeric anchors as issue references. 2015-12-01 15:53:32 +01:00
Douwe Maan 62c14ba2ed Render commit reference using short sha, but include full sha in comment. 2015-12-01 12:58:45 +01:00
Douwe Maan d6a5b45c8e Recognize issue/MR/snippet/commit links as references. 2015-11-30 21:36:34 +01:00
Douwe Maan c746a1de4e Use faster, more appropriate pipeline for mentionable attributes 2015-10-22 15:40:02 +02:00
Douwe Maan 8710739e4e Correctly find last known blob for file deleted in MR. 2015-10-20 14:24:02 +02:00
Douwe Maan 95f0440a78 Merge branch 'master' into rs-redactor-filter 2015-10-15 11:26:58 +02:00
Douwe Maan 4a5b77188e Participable doesn't need to know about Mentionable 2015-10-14 16:20:11 +02:00
Kamil Trzcinski 914cfbd2f1 Implement Commit Status API 2015-10-12 11:53:49 +02:00
Robert Speicher e9b65a3e05 Only look up Commit authors/committers by email
- Removes looking up authors/committers by name
- Renames `User.find_for_commit` to `User.find_by_any_email`
2015-06-23 18:07:15 -04:00
Robert Speicher 33df3ed384 Add `respond_to_missing?` for Commit and Repository
As of Ruby 1.9, this is the correct way to handle `respond_to?` for
methods implemented by `method_missing`.

See https://robots.thoughtbot.com/always-define-respond-to-missing-when-overriding
2015-06-10 01:31:27 -04:00
Robert Speicher 1a9da9178c Surround Project.reference_pattern in parenthesis inside other patterns 2015-05-26 15:49:22 -04:00
Robert Speicher b88da58cb6 Add `reference_pattern` to Referable models 2015-05-26 15:48:32 -04:00
Robert Speicher 0359d41b06 Implement gfm_reference directly in Mentionable
Except for Note, which still overrides it.
2015-05-26 15:48:31 -04:00
Robert Speicher c0faf91ff2 Add `to_reference` for models that support references
Now there is a single source of information for which attribute a model
uses to be referenced, and its special character.
2015-05-26 15:48:30 -04:00
Robert Speicher 38cd3d6451 Add Commit#==
Prior, comparison would use the Ruby object's ID, which got out of sync
after a Spring fork and would result in erroneous test failures.

Now we just check that the compared object is a Commit and then compare
their underlying raw commit objects.
2015-05-26 15:48:29 -04:00
Douwe Maan e739eb036d Move participants method to shared Participable concern. 2015-04-24 12:30:36 +02:00
Douwe Maan 27af24c1c9 No longer needed to pass project argument to commit methods. 2015-04-24 12:29:36 +02:00
Douwe Maan 84a1590252 Let commit model know about its project. 2015-04-24 12:29:36 +02:00
Douwe Maan 630e879066 Clean up code somewhat. 2015-04-17 11:03:33 +02:00
Douwe Maan a9b04c4536 Fix Snippet#participants. 2015-04-15 18:59:01 +02:00
Douwe Maan 959ebbcade Clean up code around commit mentions. 2015-04-15 17:57:31 +02:00
Douwe Maan 5662b24132 Don't use HTML ellipsis in EmailsOnPush subject truncated commit message. 2015-04-14 16:32:11 +02:00
Douwe Maan e33ddfebf2 Refactor ClosingIssueExtractor. 2015-04-03 18:03:26 +02:00
Douwe Maan 65bb0c3406 Only allow users to cross-reference and close issues they have access to. 2015-04-02 10:57:01 +02:00
Douwe Maan d9698628d9 Add Commit#author and #committer. 2015-04-02 10:57:01 +02:00
Dmitriy Zaporozhets 647ff6240e Rubocop: Style/ElseAlignment enabled 2015-02-02 21:38:50 -08:00
Ciro Santilli cd688a6011 Replace regex methods by string ones since faster
and more readable.
2014-12-28 23:53:27 +01:00
Jeroen van Baarsen 4eb3c47d4e Fixed a lot of already defined notices
Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>
2014-12-14 15:13:09 +01:00
Dmitriy Zaporozhets 8c01448cf9
Dontr decoarate already decorated stuff
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-10-10 17:39:29 +03:00
Dmitriy Zaporozhets ea04ed7879
Use 8chars short sha for commit in views
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-10-10 16:30:14 +03:00
Dmitriy Zaporozhets 200118357d
Use full commit sha width for reference in note body to prevent Ambiguous SHA1 prefix problem
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-10-10 15:44:27 +03:00
Dmitriy Zaporozhets 0189be0831
Use short_id instead of [0..N] for short version of commit sha
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-10-10 15:39:48 +03:00
Dmitriy Zaporozhets 03b44916ba Merge pull request #7754 from Bugagazavr/hooks
More information in merge request hook
2014-10-03 13:37:19 +03:00
Ciro Santilli 2e9f5de868 Add parenthesis to function def with arguments. 2014-10-03 09:18:46 +02:00
Kirill Zaitsev 1c9d2e39c1 Hook attributes 2014-10-02 12:58:02 +04:00
Dmitriy Zaporozhets 3695ae185b
Decorate commit parents
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-09-25 12:19:26 +03:00
Dmitriy Zaporozhets be5b6db883
Refactor diff suppress logic and diff views
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-07-15 18:28:21 +03:00
Jacob Vosmaer 3f1ece2690 Detect closing issues in Merge Request description 2014-06-13 17:25:44 +02:00
dosire 7795a4b90c The hard limit should be a lot more liberal, 10x seems reasonable. 2014-05-28 15:08:27 +02:00
skv-headless 2c28dbd254 commit description in commit list 2014-02-25 18:23:23 +04:00
Dmitriy Zaporozhets ca7e4a948b
Use new tags/branches from gitlab_git
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-02-03 18:13:24 +02:00
Boyan Tabakov 01ff084a4d Improved large commit handling.
Previously, only number of changed files mattered. Now, number of lines to render in the diff are also taken into account.

A hard limit is set, above which diffs are not rendered and users are not allowed to override that. This prevents high server
resource usage with huge commits.

Related to #1745, #2259

In addition, handle large commits for MergeRequests and Compare controllers.

Also fixes a bug where diffs are loaded twice, if user goes directly to merge_requests/:id/diffs URL.
2013-09-07 14:44:03 +03:00
ash wilson c8a115c0e3 Link issues from comments and automatically close them
Any mention of Issues, MergeRequests, or Commits via GitLab-flavored markdown
references in descriptions, titles, or attached Notes creates a back-reference
Note that links to the original referencer. Furthermore, pushing commits with
commit messages that match a (configurable) regexp to a project's default
branch will close any issues mentioned by GFM in the matched closing phrase.
If accepting a merge request would close any Issues in this way, a banner is
appended to the merge request's main panel to indicate this.
2013-08-25 18:58:41 -04:00
Dmitriy Zaporozhets 34c97a311c Increase commit title limit at Commit#show so it does not truncate most of Merge messages 2013-08-12 22:28:31 +03:00
Dmitriy Zaporozhets 49b024f5f5 Use Gitlab::Git:: for git features across application 2013-04-01 16:04:35 +03:00
Dmitriy Zaporozhets bbfbff3add Extend models functionality with old decorator methods. Use Repository model 2013-03-31 23:48:12 +03:00
Dmitriy Zaporozhets 26323046fd Decorate Gitlab::Git::Commit with Commit 2013-03-31 19:00:45 +03:00
Dmitriy Zaporozhets 154e54b46e Remove grit logic from app/ 2013-03-31 18:49:58 +03:00
Dmitriy Zaporozhets 5f9d654939 Dont show '0 additions and 0 deletions' message for commit 2013-03-21 22:50:18 +02:00