Commit Graph

273 Commits

Author SHA1 Message Date
Sean McGivern 04251829ba Merge branch 'dm-collapsed-blob' into 'master'
Consistent diff and blob size limit names

See merge request !11776
2017-06-01 09:10:53 +00:00
Douwe Maan 04cf618b6f Change no_limits to limits 2017-05-31 14:41:25 -05:00
Douwe Maan ea7269e4c6 Remove entry variable 2017-05-31 11:19:56 -05:00
Douwe Maan ce869e3964 Fix Diff#too_large? and specs 2017-05-30 21:48:30 -05:00
Douwe Maan 0c7dd30c78 Make .gitmodules parsing more resilient to syntax errors 2017-05-30 16:19:36 -05:00
Douwe Maan d9461314ad Fix Diff#to_hash and #init_from_hash 2017-05-30 14:50:02 -05:00
Douwe Maan aed0387f97 Consistent diff and blob size limit names 2017-05-29 17:02:02 -05:00
Douwe Maan 324af4ac9a Merge branch 'diffcollection-no-restarts' into 'master'
Fix buffering in DiffCollection

See merge request !11659
2017-05-26 14:35:45 +00:00
Jacob Vosmaer 16168b5b10 Use the iterator inside DiffCollection only once 2017-05-24 13:57:01 +02:00
Douwe Maan 7e09a9b7dc Clean up diff rendering 2017-05-23 15:37:05 -05:00
Douwe Maan d9a0188d2f Add question mark to Gitlab::Diff::File predicate methods 2017-05-23 15:37:04 -05:00
Douwe Maan 6319ca271c Merge branch 'gitaly-local-branches' into 'master'
Incorporate Gitaly's local_branches operation into repo code

Closes #27379

See merge request !10059
2017-05-18 14:22:41 +00:00
Alejandro Rodríguez 925945f01b Incorporate Gitaly's local_branches operation into repo code 2017-05-17 18:12:10 -04:00
Alejandro Rodríguez 71569a9c41 Compare ids of commits if present for equality test
This solves a problem where commits populated with Gitaly were not equal
to commits populated with Rugged. This is because Gitaly may not return
all fields of a commit for optimizations purposes, which resulted in
false negatives when comparing the same commit (commits with the same
sha) with different sources.
2017-05-16 20:54:45 -04:00
Alejandro Rodríguez cf09c826a5 Re-enable gitaly migration for ref_name_for_sha after bugfixes 2017-05-16 11:43:37 -04:00
Douwe Maan ffabab80a7 Merge branch 'use-gitaly-migrate' into 'master'
Use gitaly_migrate helper on all current migrations in repository

See merge request !11309
2017-05-15 18:26:55 +00:00
Jacob Vosmaer 43f037c903 Don't reuse gRPC channels
It seems that bad things happen when two gRPC stubs share one gRPC
channel so let's stop doing that. The downside of this is that we
create more gRPC connections; one per stub.
2017-05-15 10:52:33 +02:00
Ahmad Sherif 99feed6e00 Add support for deltas_only under Gitaly
Closes gitaly#199
2017-05-13 18:27:06 +02:00
Alejandro Rodríguez 6d46e51031 Use gitaly_migrate helper on all current migrations in repository 2017-05-11 16:48:59 -03:00
Jacob Vosmaer 27fb64d6a3 Remove deltas_only from DiffCollection 2017-05-11 16:01:10 +02:00
Rémy Coutable 3db37e0562 Enable the Style/TrailingCommaInArguments cop
Use the EnforcedStyleForMultiline: no_comma option.

Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-05-10 18:25:45 +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
Sean McGivern c1174901c6 Merge branch 'deltas-only' into 'master'
Don't use DiffCollection for deltas

See merge request !11201
2017-05-09 15:38:38 +00:00
Jacob Vosmaer fc0e00bd3c Remove some unused Gitlab::Git code 2017-05-09 14:51:19 +02:00
Jacob Vosmaer 48254d187f Don't use DiffCollection for deltas 2017-05-09 12:27:17 +02:00
Douwe Maan 37b1b14a16 Merge branch '30973-network-graph-sorted-by-date-and-topo' into 'master'
Sort the network graph both by commit date and topographically

Closes #30973

See merge request !11057
2017-05-04 13:56:58 +00:00
Timothy Andrew b44eaf8e07 Sort the network graph both by commit date and topographically.
- Previously, we sorted commits by date, which seemed to work okay.

- The one edge case where this failed was when multiple commits have the same
  commit date (for example: when a range of commits are cherry picked with a
  single command, they all have the same commit date [and different author
  dates]).

- Commits with the same commit date would be sorted arbitrarily, and usually
  break the network graph.

- This commit solves the problem by both sorting by date, and by sorting
  topographically (parents aren't displayed until all their children are
  displayed)

- Include review comments from @adamniedzielski

A more detailed explanation is present here:
https://gitlab.com/gitlab-org/gitlab-ce/issues/30973#note_28706230
2017-05-04 04:21:12 +00:00
Douwe Maan 4faa65d838 Merge branch '31671-merge-request-message-contains-carriage-returns' into 'master'
removes the possibility of commit messages having carriage returns

Closes #31671

See merge request !11077
2017-05-03 22:25:50 +00:00
Tiago Botelho 268ec199da removes the possibility of commit messages having carriage returns 2017-05-03 21:25:57 +01:00
Douwe Maan 720cc14a75 Refactor Blob support of external storage in preparation of job artifact blobs 2017-05-03 10:20:05 -05:00
Alejandro Rodríguez 5e0e5801f1 Re-enable ref operations with gitaly after not-found fix 2017-05-02 17:17:58 -03:00
Sean McGivern 780dcf9cdb Merge branch 'gitaly-branch-tag-count' into 'master'
Use Gitaly for getting Branch/Tag counts

Closes gitaly#157

See merge request !10780
2017-05-02 13:17:51 +00:00
Kim "BKC" Carlbäcker fe771b51fd Fix Gitaly::Commit#is_ancestor
- Upgrade Gitaly-version
2017-04-28 16:44:41 +02:00
Kim "BKC" Carlbäcker 6f89bd3628 Use Gitaly for getting Branch/Tag counts
- Backup-rake-spec fixed. Storage config broken
- Use rugged to compare branch/tag-count in specs
- upgrade gitaly
2017-04-28 13:07:53 +02:00
Douwe Maan b73b16798d Small code tweaks 2017-04-27 12:23:26 -05:00
Timothy Andrew a7e67604b3 Fix ordering of commits in the network graph.
- We upgraded `rugged` to 0.25.1.1 in !10286 for %9.1

- Prior to this upgrade, the default sort order for commits returned by
  `Gitlab::Git::Repository#find_commits` was `Rugged::SORT_DATE`, which the
  graph relied on.

- While upgrading `rugged`, the MR also changed this default to
  `Rugged::SORT_NONE`, which broke commit ordering in the graph.

- This commit adds an option to `Gitlab::Git::Repository#find_commits` to sort
  by date, and changes the graph builder `Network::Graph` so it explictly
  requests the `:date` sort order
2017-04-27 13:09:54 +00:00
James Lopez 71b6a4ba85 Return empty string on UTF8 conversion with U_STRING_NOT_TERMINATED_WARNING error 2017-04-20 16:10:33 +02:00
Douwe Maan d170133bde Refactor changing files in web UI 2017-04-20 00:37:44 +00:00
Douwe Maan d40970bf5e Normalize sizes in Gitlab::Git::Blob 2017-04-17 13:44:31 -05:00
Rémy Coutable c43f7d4713 Merge branch 'gitaly-testing' into 'master'
Setup and run a Gitaly server for testing if GitalyClient is enabled

See merge request !10298
2017-04-12 09:25:09 +00: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
Rémy Coutable ae88355bb8 Retrieve Git-specific env in Gitlab::Git::RevList and add a new #new_refs method
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-04-10 16:10:18 +02:00
Rémy Coutable cb20cfa244 Retrieve Git-specific env in Gitlab::Git::Repository#rugged
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-04-10 16:10:18 +02:00
Rémy Coutable 05aa038c42 Add a Gitlab::Git::Env to store Git-specific env thread-safely
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-04-10 16:10:18 +02:00
Jacob Vosmaer 20d415a676 Use Gitlab::Git::Repository#gitaly_... more 2017-04-07 12:53:30 +02:00
Jacob Vosmaer e4ac948c70 Send more Gitaly::Repository fields 2017-04-07 12:53:30 +02:00
Kim "BKC" Carlbäcker 70982bb420 Hopefully this works 2017-04-06 12:10:03 +02:00
Kim "BKC" Carlbäcker 0fc361c4dc Use Gitaly for Environment#first_deployment_for 2017-04-06 11:53:34 +02:00
Alejandro Rodríguez 267cd3e359 Incorporate Gitaly client for refs service 2017-04-04 16:53:44 +02:00
Douwe Maan b2700e64cc Merge branch '22303-symbolic-in-tree' into 'master'
#22303 fix mode representation git::tree ( in base 8 )

Closes #22303

See merge request !9780
2017-04-03 15:59:24 +00:00
Robert Speicher e7e9307219 Merge branch 'use-gitaly-commit-is-ancestor' into 'master'
Use gitaly commit is ancestor

See merge request !9864
2017-04-02 17:36:25 +00:00
mhasbini ed5d59d4c4 Fix symlink icon in project tree 2017-04-02 14:42:37 +03:00
Robert Speicher bf0590b3e2 Merge branch 'allow-multiple-paths-in-repository-log' into 'master'
Support >1 path in Gitlab::Git::Repository#log

See merge request !10291
2017-03-30 14:56:43 +00:00
Kim "BKC" Carlbäcker 1ea0ce827a Make GitLab use Gitaly for commit_is_ancestor
- Migration in Repository#is_ancestor?
2017-03-30 16:06:31 +02:00
Sean McGivern 53819c5ac6 Support >1 path in Gitlab::Git::Repository#log
This is analogous to `git log -- foo bar baz`, but not the same as
`Gitlab::Git::Repository#log(path: 'foo bar baz')`, which would run `git
log -- 'foo bar baz'`.
2017-03-30 10:21:19 +01:00
Adam Niedzielski 91e150266a Use Rugged::SORT_NONE instead of Rugged::SORT_DATE
Meaning of SORT_DATE was changed in libgit2.
See 82d4c0e6b8

SORT_NONE is the order produced by "git log".
2017-03-28 14:19:52 +02:00
Adam Niedzielski e396b43771 Remove unused method Gitlab::Git::Repository#commits_since 2017-03-28 14:19:52 +02: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
Mark Fletcher 4597654079 Fix archive prefix bug for refs containing dots 2017-03-16 21:04:58 +05:30
Ahmad Sherif c0a4f527db Use Gitaly for CommitController#show 2017-03-15 12:52:11 +02:00
Oswaldo Ferreira d13451cd49 Returns correct header data for commits endpoint 2017-03-07 22:56:31 -03:00
George Andrinopoulos c46f933bb7 Fix pagination headers for repository commits api endpoint 2017-03-07 22:56:31 -03:00
Rémy Coutable d415419532 Merge branch '28805-download-archive-with-branch-like-feature-xxxx-add-extra-directory-level' into 'master'
Ensure archive download is only one directory deep

Closes #28805

See merge request !9616
2017-03-02 08:37:07 +00:00
Mark Fletcher 3ac54d22b9 Ensure archive download is only one directory deep 2017-03-02 10:30:24 +05:30
Sean McGivern 811e598f60 Enable and autocorrect the CustomErrorClass cop 2017-03-01 15:28:10 +00:00
Robert Speicher cecfcc2edd Merge branch '23062-allow-git-log-to-accept-follow-and-skip' into 'master'
Make Git history follow renames again by performing the --skip in Ruby

Closes #23062

See merge request !9314
2017-02-25 19:58:05 +00:00
Douwe Maan c72e715522 Raise error when no content is provided 2017-02-24 09:55:01 -06:00
Douwe Maan a530e9da35 Address review 2017-02-24 09:55:01 -06:00
Douwe Maan 564b0eb017 Fix new offenses 2017-02-24 09:55:01 -06:00
Douwe Maan 0625af3bcb Consistently create, update, and delete files, taking CRLF settings into account 2017-02-24 09:55:01 -06:00
Rémy Coutable 9720bcd83d Optimize a bit Gitlab::Git::Repository#log_by_shell and its specs
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-02-23 19:06:00 +01:00
Rémy Coutable 3eb0354061 Make Git history follow renames again by performing the --skip in Ruby
This hack is needed because of an issue when --follow and --skip
are passed to git log at the same time.

See https://gitlab.com/gitlab-org/gitlab-ce/issues/23062

Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-02-23 19:06:00 +01:00
Douwe Maan f88ff0cc0c Stylistic tweaks 2017-02-23 09:33:20 -06:00
Douwe Maan 56de781a2c Revert "Enable Style/DotPosition"
This reverts commit e00fb2bdc2090e9cabeb1eb35a2672a882cc96e9.

# Conflicts:
#	.rubocop.yml
#	.rubocop_todo.yml
#	lib/gitlab/ci/config/entry/global.rb
#	lib/gitlab/ci/config/entry/jobs.rb
#	spec/lib/gitlab/ci/config/entry/factory_spec.rb
#	spec/lib/gitlab/ci/config/entry/global_spec.rb
#	spec/lib/gitlab/ci/config/entry/job_spec.rb
#	spec/lib/gitlab/ci/status/build/factory_spec.rb
#	spec/lib/gitlab/incoming_email_spec.rb
2017-02-23 09:33:19 -06:00
Douwe Maan 1fe7501b49 Revert "Prefer leading style for Style/DotPosition"
This reverts commit cb10b725c8929b8b4460f89c9d96c773af39ba6b.
2017-02-23 09:33:05 -06:00
Douwe Maan b3ff48c9a1 Move up delegate calls 2017-02-23 09:32:42 -06:00
Douwe Maan 32a7041030 ActiveSupport delegation is preferred over Forwardable 2017-02-23 09:32:42 -06:00
Douwe Maan 75f5fa997d Enable Rails/Delegate 2017-02-23 09:32:42 -06:00
Douwe Maan 206953a430 Prefer leading style for Style/DotPosition 2017-02-23 09:32:22 -06:00
Douwe Maan 3dadf306dd Enable Style/DotPosition 2017-02-23 09:31:56 -06:00
Z.J. van de Weg 128b1eae09 Update Rubocop to ruby 2.3 2017-02-07 15:16:46 +01:00
Rémy Coutable 2ac0178564
Remove some useless require_relative statements
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-01-17 01:22:01 -05:00
Robert Schilling 22a34c81aa Use configured git rather than system git 2017-01-05 13:46:26 +01:00
Robert Speicher 2e20a71d21 Ensure internal Gitlab::Git references use the namespace 2017-01-04 19:09:29 -05:00
Robert Speicher a00578ce5c Absorb gitlab_git 2017-01-04 19:09:28 -05:00
Rémy Coutable 212967aefb
Reject blank environment vcariables in Gitlab::Git::RevList
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-12-20 09:45:37 +01:00
Timothy Andrew e394d2872a Implement final review comments from @rymai.
- `raise "string"` raises a `RuntimeError` - no need to be explicit
- Remove top-level comment in the `RevList` class
- Use `%w()` instead of `%w[]`
- Extract an `environment_variables` method to cache `env.slice(*ALLOWED_VARIABLES)`
- Use `start_with?` for env variable validation instead of regex match
- Validation specs for each allowed environment variable were identical. Build them dynamically.
- Minor change to `popen3` expectation.
2016-12-16 23:32:25 +05:30
Timothy Andrew 3e1442766f Implement review comments from @dbalexandre.
- Don't define "allowed environment variables" in two places.
- Dispatch to different arities of `Popen.open` without an if/else block.
- Use `described_class` instead of explicitly stating the class name within a
- spec.
- Remove `git_environment_variables_validator_spec` and keep the validation inline.
2016-12-16 23:32:25 +05:30
Timothy Andrew a2b39feb1a Validate environment variables in `Gitlab::Git::RevList`
The list of environment variables in `Gitlab::Git::RevList` need to be validate
to make sure that they don't reference any other project on disk.

This commit mixes in `ActiveModel::Validations` into `Gitlab::Git::RevList`, and
validates that the environment variables are on the level (using a custom
validator class). If the validations fail, the force push is still executed
without any environment variables set.

Add specs for the validation using shared examples.
2016-12-16 23:32:25 +05:30
Timothy Andrew f82d549d26 Accept environment variables from the `pre-receive` script.
1. Starting version 2.11, git changed the way the pre-receive flow works.

  - Previously, the new potential objects would be added to the main repo. If the
    pre-receive passes, the new objects stay in the repo but are linked up. If
    the pre-receive fails, the new objects stay orphaned in the repo, and are
    cleaned up during the next `git gc`.

  - In 2.11, the new potential objects are added to a temporary "alternate object
    directory", that git creates for this purpose. If the pre-receive passes, the
    objects from the alternate object directory are migrated to the main repo. If
    the pre-receive fails the alternate object directory is simply deleted.

2. In our workflow, the pre-recieve script (in `gitlab-shell) calls the
   `/allowed` endpoint, which calls out directly to git to perform
   various checks. These direct calls to git do _not_ have the necessary
   environment variables set which allow access to the "alternate object
   directory" (explained above). Therefore these calls to git are not able to
   access any of the new potential objects to be added during this push.

3. We fix this by accepting the relevant environment variables
   (GIT_ALTERNATE_OBJECT_DIRECTORIES, GIT_OBJECT_DIRECTORY) on the
   `/allowed` endpoint, and then include these environment variables while
   calling out to git.

4. This commit includes (whitelisted) these environment variables while making
   the "force push" check. A `Gitlab::Git::RevList` module is extracted to
   prevent `ForcePush` from being littered with these checks.
2016-12-16 23:32:25 +05:30
Valery Sizov 7185722457 Clean environment variables when running git hooks 2016-09-15 08:51:55 +03:00
Douwe Maan bf89e06a45 Merge branch '18627-wildcard-branch-protection' into 'master'
Allow specifying protected branches using wildcards

Closes #18627 

# Tasks

- [ ]  #18627 !4665 Allow specifying protected branches using wildcards
    - [x]  Find existing usages of protected branches
        - Protecting branches
            - `ProtectedBranchesController` is used to mark a branch protected/unprotected
            - `API::Branches` can be used to mark a branch protected/unprotected
        - Enforcing branch protection
            - `Gitlab::GitAccess` has helpers (`can_push_to_branch?`, `check`) that are used to deny pushes if a branch is protected
            - Over SSH: `gitlab-shell` receives a push, and calls `/allowed` on the GitLab API, which calls `GitAccess.check`
            - Over HTTP: 
                - `gitlab-workhorse` receives the request, and forwards it to rails
                - Rails (in the `GitHttpController#git-recieve-pack`) runs basic checks (is the user logged in, not protected branch checks) and returns ok with `GL_ID` and `RepoPath`
                - `gitlab-workhorse` looks at the response, and calls the relevant `gitlab-shell` action from `git-http/handlePostRPC`
                - Rest of this flow is the same as the SSH flow above
    - [x]  Implementation
        - [x]  Backend
            - [x]  Change `project#protected_branch?` to look at wildcard protected branches
            - [x]  Change `project#developers_can_push_to_protected_branch?`
            - [x]  Change `project#open_branches`
            - [x]  Better error message when creating a disallowed branch from the Web UI
        - [x]  Frontend
            - [x]  Protected branches page should allow typing out a wildcard pattern
            - [x]  Add help text explaining the use of wildcards
            - [x]  Show matching branches for each protected branch
                - [x]  ~~On the index page~~
                - [x]  On a show page
                - [x]  Index?
            - [x]  Can't have the "last commit" column for wildcard protected branches
    - [x]  Fix / write tests
    - [x]  What happens if a hook is missing in dev?
    - [x]  Refactor
    - [x]  Test workflows
        - Create a branch matching a wildcard pattern
        - Push to a branch matching a wildcard pattern
        - Force push to a branch matching a wildcard pattern
        - Delete a branch matching a wildcard pattern
        - [x]  Test using Web UI
        - [x]  Test over SSH
        - [x]  Test over HTTP
        - [x]  Test as developer and master
    - [x]  Investigate performance
        - [x]  Test with a large number of protected branches / branches
        - [x]  Paginate list of protected branches
        - [x]  ~~Possibly rewrite `open_branches`~~
    - [x]  Add `iid`s to existing `ProtectedBranch`es
    - [x]  Add documentation
    - [x]  Add CHANGELOG entry
    - [x]  Add screenshots
    - [x]  Make sure [build](2f753e3ed2/builds) passes
    - [x]  Assign to endboss for review
    - [x]  Address @DouweM's comments
        - [x]  `protected_branch_params`
        - [x]  `exact_match` instead of `explicit_match`
        - [x]  When would self.name be blank?
        - [x]  Move `protected_branches.each` to a partial
        - [x]  Move `matching_branches.each` to a partial
        - [x]  If the branch is in @matching_branches, it's not been removed
        - [x]  move this regex to a method and memoize it
        - [x]  `commit_sha` directly for exact matches
        - [x]  Number of matches for wildcard matches, with a link
    - [x]  Wait for [build](43f9ce0e88/builds) to pass
    - [x]  Respond to @DouweM's comments
        - [x]  Don't use iid
        - [x]  Controller should use `@project.protected_branches.new`
        - [x]  move the memoization to `def wildcard_regex`
        - [x]  render with `collection: @protected_branches`
    - [x]  Wait for [build](f7beedf122/builds) to pass
    - [x]  Wait for @DouweM's review
    - [x]  Wait for @jschatz1's review
    - [x]  Respond to @jschatz1's comments
        - [x]  Use the new dropdown style
        - [x]  description should be moved to the description section without the styling
        - [x]  Protect button should be disabled when no branch is selected
    - [x]  Update screenshots
    - [x]  Merge conflicts
    - [x]  Make sure [build](20f3cfe8d5/builds) passes
    - [ ]  Revisit performance, possibly with staging/production data
        - [ ]  Get a dump of staging / run against staging live
            - [ ]  Get SSH access to staging
    - [ ]  Wait for review/merge






# Screenshots

## Creating wildcard protected branches

![1](/uploads/9446afccfdf6fa381e00c800dd2cc82e/1.png)
![2](/uploads/0b154503b297a818d3577488c575d845/2.png)
![3](/uploads/36217f79df9e41cc1550601f02627fe8/3.png)
![4](/uploads/041ca9bd529bcfa5373fca67e917cbcb/4.png)

### Using the `GLDropdown` component

![2016-06-30_14-16-15](/uploads/508afc2a5e2463c2954641409a560d88/2016-06-30_14-16-15.gif)

## Enforcing wildcard protected branches

### From the Web UI

![Screen_Shot_2016-06-20_at_1.21.18_PM](/uploads/8b5d4b1911e9152698a0488daf1880bc/Screen_Shot_2016-06-20_at_1.21.18_PM.png)

### Over SSH

![SSH](/uploads/7365989d7e4c406ef37b6ae5106442c9/SSH.gif)

### Over HTTPS

![HTTPS](/uploads/a7c0f56ae58efcffc75e6700fa2f4ac0/HTTPS.gif)

## Listing matching branches

![Screen_Shot_2016-06-20_at_1.33.44_PM](/uploads/d054113022f5d7ec64c0e57e501ac104/Screen_Shot_2016-06-20_at_1.33.44_PM.png)

See merge request !4665
2016-07-07 22:37:30 +00:00
Patricio Cano ace309d775 Raise an error if no protocol is passed to the GitAccess check. 2016-07-05 16:54:22 -05:00
Patricio Cano 8b14d1d2c2 Rename ENV['PROTOCOL'] to ENV['GL_PROTOCOL'] to conform to what GitLab Shell expects and make the `protocol` param in `GitAccess` mandatory. 2016-07-05 16:54:22 -05:00
Patricio Cano 7735ef86f0 Only allow Git Access on the allowed protocol 2016-07-05 16:54:22 -05:00
Timothy Andrew eb16e1e3c2 Improve the error message displayed when branch creation fails.
Note: This feature was developed independently on master while this was
in review. I've removed the conflicting bits and left the relevant
additions, mainly a test for `Gitlab::Git::Hook`. The original commit
message follows:

1. `gitlab-shell` outputs errors to `stderr`, but we weren't using this
   information, prior to this commit. Now we capture the `stderr`, and
   display it in the flash message when branch creation fails.

2. This can be used to display better errors for other git operation
   failures with small tweaks.

3. The return value of `Gitlab::Git::Hook#trigger` is changed from a
   simple `true`/`false` to a tuple of `[status, errors]`. All usages
   and tests have been updated to reflect this change.

4. This is only relevant to branch creation _from the Web UI_, since SSH
   and HTTP pushes access `gitlab-shell` either directly or through
   `gitlab-workhorse`.

5. A few minor changes need to be made on the `gitlab-shell` end. Right
   now, the `stderr` message it outputs is prefixed by "GitLab: ", which
   shows up in our flash message. This is better removed.
2016-07-05 11:05:16 +05:30
Valery Sizov 926a8ab476 Handle custom Git hook result in GitLab UI 2016-07-04 20:16:55 +03:00
Valery Sizov bf218337ed Better message for git hooks and file locks 2016-07-04 15:31:49 +03:00
Valery Sizov ae18ba1632 Fire update hook from GitLab 2015-11-30 18:36:34 +02:00
Dmitriy Zaporozhets 4e4866f255 Refactor pre/post receive commit services into one class 2015-08-14 16:04:17 +02:00
Dmitriy Zaporozhets 4f2d2c90f7 Move Gitlab::Git out of gitlab core 2013-04-27 23:50:17 +03:00
Sato Hiroyuki 05c2c15cd1 Fix Gitlab::Git::Repository#commit returns wrong commit, if commit_id is "tag name". 2013-04-25 20:54:00 +00:00
Dmitriy Zaporozhets 85ec345183 Prevent 500 error on git blame if empty file 2013-04-18 12:46:41 +03:00
Dmitriy Zaporozhets 14798b8e68 symbolize keys for Gitlab::Git::Diff & Gitlab::Git::Commit 2013-04-16 16:29:49 +03:00
Dmitriy Zaporozhets 4da8b37e67 Fix bug when limit or offset passed as string 2013-04-15 19:02:36 +03:00
Dmitriy Zaporozhets d74d7c7cfb Update app code to use Gitlab::Git::Diff 2013-04-15 19:02:05 +03:00
Dmitriy Zaporozhets 5f8f685bd4 Init Gitlab::Git::Diff class 2013-04-15 19:01:02 +03:00
akzhan b1a8fdd84d Git log follow support 2013-04-15 16:53:19 +03:00
Dmitriy Zaporozhets f8a4a76048 decorate commits in Gitlab::Git::repository with valid class 2013-04-03 21:17:50 +03:00
Dmitriy Zaporozhets 3011ac4150 Refactoring and cleanup. Removed unused commit finders 2013-04-03 21:05:10 +03:00
Dmitriy Zaporozhets 7e8bf92bd7 remove unnecessary decorations 2013-04-03 09:32:17 +03:00
Dmitriy Zaporozhets 94390fc7b4 Proper routing. blobs for blobs, raw for send_data 2013-04-03 09:26:38 +03:00
Dmitriy Zaporozhets 88abe66c27 add alias for committed_date 2013-04-02 22:39:37 +03:00
Dmitriy Zaporozhets 03f41e2820 Gitlab::Git::Tree & Blob added 2013-04-02 22:37:20 +03:00
Dmitriy Zaporozhets 0c5795a497 serialize parent_ids in commit 2013-04-02 21:46:19 +03:00
Dmitriy Zaporozhets 5f4445c3d3 store commits for MR as array of hashes 2013-04-02 21:30:36 +03:00
Dmitriy Zaporozhets 9a26e9a0d6 Dont init repo on every create(:repo) 2013-04-01 17:27:44 +03:00
Dmitriy Zaporozhets 49b024f5f5 Use Gitlab::Git:: for git features across application 2013-04-01 16:04:35 +03:00
Dmitriy Zaporozhets bb06e905ef added Gitlab::Git::Compare for git compare feature 2013-04-01 16:03:11 +03:00
Dmitriy Zaporozhets 51c167554c added Gitlab::Git::Blame for git blame feature 2013-04-01 16:02:54 +03:00
Dmitriy Zaporozhets 22817398e6 define TestEnv and keep all global stubs in one place 2013-04-01 14:39:19 +03:00
Dmitriy Zaporozhets 26323046fd Decorate Gitlab::Git::Commit with Commit 2013-03-31 19:00:45 +03:00
Dmitriy Zaporozhets 676bce2ab9 Move Commit and Repository logic to lib/gitlab/git 2013-03-31 18:49:06 +03:00