Commit Graph
21935 Commits
Author SHA1 Message Date
Stan Hu ff8cd116a0 Disable --follow in git log to avoid loading duplicate commit data in infinite scroll
`git` doesn't work properly when `--follow` and `--skip` are specified together. We could even be **omitting commits in the Web log** as a result.

Here are the gory details. Let's say you ran:

```
git log -n=5 --skip=2 README
```

This is the working case since it omits `--follow`. This is what happens:

1. `git` starts at `HEAD` and traverses down the tree until it finds the top-most commit relevant to README.
2. Once this is found, this commit is returned via `get_revision_1()`.
3. If the `skip_count` is positive, decrement and repeat step 2. Otherwise go onto step 4.
4. `show_log()` gets called with that commit.
5. Repeat step 1 until we have all five entries.

That's exactly what we want. What happens when you use `--follow`? You have to understand how step 1 is performed:

* When you specify a pathspec on the command-line (e.g. README), a flag `prune` [gets set here](https://github.com/git/git/blob/master/revision.c#L2351).
* If the `prune` flag is active, `get_commit_action()` determines whether the commit should be [scanned for matching paths](https://github.com/git/git/blob/master/revision.c#L2989).
* In the case of `--follow`, however, `prune` is [disabled here](https://github.com/git/git/blob/master/revision.c#L2350).
* As a result, a commit is never scanned for matching paths and therefore never pruned. `HEAD` will always get returned as the first commit, even if it's not relevant to the README.
* Making matters worse, the `--skip` in the example above would actually skip every other after `HEAD` N times. If README were changed in these skipped commits, we would actually miss information!

Since git uses a matching algorithm to determine whether a file was renamed, I
believe `git` needs to generate a diff of each commit to do this and traverse
each commit one-by-one to do this. I think that's the rationale for disabling
the `prune` functionality since you can't just do a simple string comparison.

Closes #4181, #4229, #3574, #2410
2015-12-25 01:28:33 -08:00
Robert Speicher 350d65503f Merge branch 'ref-filter-html' into 'master'
Escape all the things.

See merge request !2209
2015-12-24 22:19:36 +00:00
Douwe Maan 37993d3957 Escape all the things. 2015-12-24 21:36:33 +01:00
Douwe Maan 7b25da74ea Merge branch 'fix-add-key-submit' into 'master'
Enable "Add key" button when user fills in a proper key

Closes #4295

See merge request !2208
2015-12-24 20:28:34 +00:00
Stan Hu 8309ef45a9 Enable "Add key" button when user fills in a proper key
Closes #4295
2015-12-24 11:34:32 -08:00
Robert Speicher e3befaed82 Update CHANGELOG
[ci skip]
2015-12-24 14:14:03 -05:00
Robert Speicher 1042c16b4b Merge branch 'master' of github.com:gitlabhq/gitlabhq 2015-12-24 14:00:29 -05:00
Robert Speicher a9b82220e8 Merge branch 'fix-changelog' into 'master'
Move changelog items to their correct place.

Fixes #4236

See merge request !2201
2015-12-24 13:59:02 -05:00
Douwe Maan 835333c426 Merge branch 'ldap-special-chars-fix' into 'master'
Fix identity and user retrieval when special characters are used

Fixes #4023

I also added tests to make sure the user with special characters in his name is returned correctly.

@rspeicher this probably should be added to 8.3 as a patch.

See merge request !2176
2015-12-24 16:35:00 +00:00
Valery Sizov e1a47bd123 Merge branch 'emoji_picker_frequently_used' into 'master'
Emoji picker: add "frequently used" category

depend on !2172

![Screen_Shot_2015-12-24_at_16.39.04](/uploads/7117173c6f519282054bcb1b7ba248f4/Screen_Shot_2015-12-24_at_16.39.04.png)


See merge request !2180
2015-12-24 15:58:32 +00:00
Dmitriy Zaporozhets 7caaa10807 Merge pull request #9915 from huacnlee/avoid-ability-methods-allocations
Avoid allocations in Ability class.
2015-12-24 16:28:03 +01:00
Dmitriy Zaporozhets 1a23af485c Merge branch 'fix-explore-ui' into 'master'
Fix explore projects page UI

# Before

![Screenshot_2015-12-24_14.13.03](/uploads/fdae7648acc8b8076709e4bfc867a5f8/Screenshot_2015-12-24_14.13.03.png)


# After

![Screenshot_2015-12-24_14.11.29](/uploads/b1ecd3bebfadab9d2ceabaae27046271/Screenshot_2015-12-24_14.11.29.png)



cc @jschatz1 @skyruler 


Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>


See merge request !2202
2015-12-24 15:05:28 +00:00
Valery Sizov 355e62eb49 added default for frequently used emojis 2015-12-24 16:40:10 +02:00
Douwe Maan 0869d84c07 Merge branch 'fix-master' into 'master'
Fix NewBranchForm spec

cc @vsizov 

See merge request !2204
2015-12-24 14:36:36 +00:00
Dmitriy Zaporozhets aa712e2b36 Merge branch 'new-project-header-redesign' into 'master'
Dropdowns for clone. Star and Fork with new count areas. Star and Unstarred Works now

Fixes #2876 and #3482
Used existing styles. <br/>
Did not attempt to make pixel perfect as styles already exist. <br/>

![Screen_Shot_2015-12-18_at_5.24.56_PM](/uploads/a79ba1e0be0232f2aeef8a43f3253479/Screen_Shot_2015-12-18_at_5.24.56_PM.png)

See merge request !2156
2015-12-24 14:17:11 +00:00
Douwe Maan 93b5ea6f0e Fix NewBranchForm spec 2015-12-24 15:09:29 +01:00
Valery Sizov d84ca3e815 Merge branch 'emoji-picker-search' into 'master'
Emoji picker search

depend on !2172

Issue https://gitlab.com/gitlab-org/gitlab-ce/issues/3576

!!! Should be merged after https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/2198

![Screenshot_2015-12-23_11.44.57](/uploads/01da0b62c3c234307142e2c4db68e53f/Screenshot_2015-12-23_11.44.57.png)

See merge request !2186
2015-12-24 13:58:49 +00:00
Valery Sizov a55b653d93 fix of frequently used emojis 2015-12-24 15:44:43 +02:00
Dmitriy Zaporozhets 40a3845fab Fix explore projects page UI
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2015-12-24 14:11:51 +01:00
Valery Sizov 5ed1256492 Merge branch 'emoji-picker-search' into emoji_picker_frequently_used 2015-12-24 15:06:51 +02:00
Dmitriy Zaporozhets 1f9633d67c Merge branch 'fix-milestones-with-slashes' into 'master'
Fix Error 500 when global milestones have slashes

* Closes #4226

* Closes https://github.com/gitlabhq/gitlabhq/issues/9921

See merge request !2182
2015-12-24 13:04:43 +00:00
Valery Sizov 44cf1cbaaf Merge remote-tracking branch 'origin/master' into emoji-picker-search 2015-12-24 14:57:07 +02:00
Valery Sizov 6d07054747 fix specs 2015-12-24 14:54:02 +02:00
Dmitriy Zaporozhets d1043c4389 Merge branch 'new-nav-width' into 'master'
nav full width

old
![Screen_Shot_2015-12-21_at_3.47.01_PM](/uploads/ef47c61eb33521087fc40d400d01cba8/Screen_Shot_2015-12-21_at_3.47.01_PM.png)

new
![Screenshot_2015-12-24_12.16.53](/uploads/30cf37886b3710a22daa0b82583975e9/Screenshot_2015-12-24_12.16.53.png)


See merge request !2200
2015-12-24 12:35:24 +00:00
Dmitriy Zaporozhets 76b7e24f85 Merge branch 'edit-on-fork' into 'master'
Automatically fork a project when not allowed to edit a file.

Fixes #3215.

To do:

- [ ] Add tests

-----

## "Edit" button on file in a project the user does NOT have write access to

![edit_file](/uploads/7602157420768aef483a6586bba2d164/edit_file.png)

## Clicking will automatically create a fork

![during_fork](/uploads/32f4f5dff9f24ea99522000b0bf881c5/during_fork.png)

## When the fork has been created, the user is returned to the edit page on the original project with a notice

![edit_notice](/uploads/94ed1319404370ff1e9c0d672fb41e03/edit_notice.png)

## The user cannot change the target branch and is informed that editing will start an MR

![edit_footer](/uploads/4da68d4795c7177e575b7c434d16eeae/edit_footer.png)

## Hitting "Commit changes" will commit and start an MR from my fork to the origin project

![Screen_Shot_2015-12-17_at_23.38.08](/uploads/d777a4db6f38a5a1be84031694465bc1/Screen_Shot_2015-12-17_at_23.38.08.png)

-----

## "Create file, "Upload file" and "New directory" buttons in a project the user does NOT have write access to

![new_directory](/uploads/72f556248f30d6652523bbb4be01b3e0/new_directory.png)

## Clicking any of these options will automatically create a fork

![during_fork](/uploads/32f4f5dff9f24ea99522000b0bf881c5/during_fork.png)

## When the fork has been created, the user is returned to the tree page on the original project with a notice

![new_directory_notice](/uploads/a1a3e11308ae0e8f0913fae6813a37ed/new_directory_notice.png)

## Clicking "New directory" again will show the modal. The user cannot change the target branch and is informed that editing will start an MR

![new_dir](/uploads/99ca8cbfb2f70603e352b3fdf67b6281/new_dir.png)

## Hitting "Create directory" will commit and start an MR from my fork to the origin project

![Screen_Shot_2015-12-17_at_23.39.19](/uploads/3713d0235abf831361b803a6198c5bc1/Screen_Shot_2015-12-17_at_23.39.19.png)

cc @dzaporozhets @skyruler

See merge request !2145
2015-12-24 12:24:57 +00:00
Douwe Maan 7309b848e2 Move changelog items to their correct place. 2015-12-24 12:20:00 +00:00
Douwe Maan 84e75ebd4c Merge branch 'fix/visibility-level-setting-in-forked-projects' into 'master'
Fix/visibility level setting in forked projects

Fixes #3136

/cc @DouweM 

See merge request !1744
2015-12-24 12:09:38 +00:00
Douwe Maan 6b968a8fcd Merge branch 'branch-invalid-name' into 'master'
Add JS validation for invalid characters  in branch name

Fixes #3293 

Demo:

![out-1080p](/uploads/ba21c359b6b8b440c40cacf772ec0df7/out-1080p.gif)


See merge request !2122
2015-12-24 11:42:25 +00:00
Douwe Maan 541da4d51f Merge branch 'issue_4189' into 'master'
Fix redirect to wrong URL when merging and MR detail URL has an anchor.

Closes #4189

See merge request !2169
2015-12-24 11:41:36 +00:00
Valery Sizov 999a374f77 Merge branch 'emoji-picker-search'into emoji_picker_frequently_used 2015-12-24 13:38:17 +02:00
Douwe Maan 662aa8ec35 No mb_chars needed anymore 2015-12-24 12:37:46 +01:00
Valery Sizov e622259d5b Merge branch 'emoji-picker-fix' into 'master'
Emoji picker: better alias handling

related to https://gitlab.com/gitlab-org/gitlab-ce/issues/3576

See merge request !2198
2015-12-24 11:24:03 +00:00
Andriy Dyadyura 5939d24756 nav full width 2015-12-24 12:22:01 +01:00
Dmitriy Zaporozhets 75c3a2f89b Merge branch 'rs-bump-underscore-rails' into 'master'
Bump underscore-rails to ~> 1.8.0

Addresses #2857

See merge request !2193
2015-12-24 10:36:36 +00:00
Dmitriy Zaporozhets d095cbd70b Merge branch 'filter-project-list-fix' into 'master'
fixes the search for projects

Also makes improvements for jQuery queries. <br/>
@creamzy @skyruler <br/>
Fixes issues introduced in MR for #3943

See merge request !2194
2015-12-24 10:35:57 +00:00
Valery Sizov e557c8d0a2 Merge branch 'emoji-picker-fix' into emoji-picker-search 2015-12-24 12:16:10 +02:00
Valery Sizov 09c5968fa3 fix spec 2015-12-24 12:14:46 +02:00
Valery Sizov d4e9c75844 Merge remote-tracking branch 'origin/master' into emoji-picker-search 2015-12-24 12:01:22 +02:00
Valery Sizov 5da8c1f77a fixes after review 2015-12-24 11:57:46 +02:00
Valery Sizov 694579ce04 Merge branch 'emoji-picker-fix' into emoji-picker-search 2015-12-24 11:50:58 +02:00
Tomasz Maczukin c301ab0404 Add some specs for forked project visibility_level cases 2015-12-24 10:33:26 +01:00
Valery Sizov b6de0d2830 Emoji picker: better alias handling 2015-12-24 11:28:55 +02:00
Robert Speicher 94a55045dc Merge branch 'its-its' into 'master'
Fix spelling of "it's" to "its" where appropriate.

[ci skip]

See merge request !2196
2015-12-24 04:38:07 +00:00
cafuego 9c893af7ad Fix spelling of "it's" to "its" where appropriate. 2015-12-24 15:28:12 +11:00
Jacob Schatz a1294e5aab fixes css spacing issues 2015-12-23 20:39:42 -05:00
Jacob Schatz 6592bfbb9e Moves star code to a class 2015-12-23 20:36:29 -05:00
Jacob Schatz 7ba4482fcf fixes failing test by updating project clone instructions 2015-12-23 19:57:30 -05:00
Jacob Schatz 77daadc92c Merge branch 'master' into new-project-header-redesign 2015-12-23 18:59:06 -05:00
Jacob Schatz 3ece40c222 fixes the search for projects 2015-12-23 18:27:38 -05:00
Dmitriy Zaporozhets c75ac8218e Merge branch 'fix-error-500-global-search-issues' into 'master'
Fix Error 500 when doing a search in dashboard before visiting any project

If a search turned up an issue, under certain conditions you would see this error:

```
ActionView::Template::Error (undefined method `path_with_namespace' for nil:NilClass):
     6:   - if issue.description.present?
     7:     .description.term
     8:       = preserve do
     9:         = search_md_sanitize(markdown(issue.description))
    10:   %span.light
    11:     #{issue.project.name_with_namespace}
    12:   - if issue.closed?
  lib/gitlab/markdown/upload_link_filter.rb:36:in `build_url'
  lib/gitlab/markdown/upload_link_filter.rb:31:in `process_link_attr'
  lib/gitlab/markdown/upload_link_filter.rb:18:in `block in call'
  lib/gitlab/markdown/upload_link_filter.rb:17:in `call'
  lib/gitlab/markdown.rb:127:in `gfm'
  lib/gitlab/markdown.rb:24:in `render'
  app/helpers/gitlab_markdown_helper.rb:61:in `markdown'
  app/views/search/results/_issue.html.haml:9:in `block in _app_views_search_results__issue_html_haml__4127460390996300432_59973760'
  app/views/search/results/_issue.html.haml:8:in `_app_views_search_results__issue_html_haml__4127460390996300432_59973760'
  app/views/search/_results.html.haml:20:in `_app_views_search__results_html_haml__589475855773452465_61761440'
  app/views/search/show.html.haml:5:in `_app_views_search_show_html_haml___1852335078065998536_69780120'
```

Confirmed this is issue still happens in GitLab 8.4, and it also happens on GitLab.com. Here's how to reproduce:

1. Login in a new browser.
2. Enter a search term on the top right that will land a hit in the "Issues" (e.g. GitLab).
3. Click on "Issues" tab. You should get an Error 500.

The issue is that @project isn't assigned to anything.

See merge request !2110
2015-12-23 22:46:23 +00:00