gitlab-org--gitlab-foss/app/models
Rémy Coutable bfc6a0e371 Merge branch 'gitattributes' into 'master'
Support supressing text file diffs on the default branch with .gitattributes

This change allows users to suppress diffs for text files by adding an entry to the `.gitattributes` file. To take effect the file present at the HEAD of the default branch.

When rendering a diff, if the file is text according to the charlock holmes gem (via the `text?` method) but the file is not diffable according to the project repository, then a message is displayed stating that the diff was suppressed.

![image](/uploads/2e119b725875a301e30d9ad482e283b3/image.png)

I looked into ways to do this using a `binary` flag as suggested by @stanhu in [this comment](https://gitlab.com/gitlab-org/gitlab-ce/issues/2315#note_4435454), however, there was no good way to seperate what was a real binary file from one that had been marked as not diffable in `.gitattributes`.

Fixes and closes gitlab-org/gitlab-ce#2315.

See merge request !3806
2016-04-29 12:40:13 +00:00
..
ci Merge branch 'ci-commit-as-pipeline' into 'master' 2016-04-21 08:10:37 +00:00
concerns Use a better message when milestone is newly created 2016-04-29 10:15:49 +01:00
hooks add slack notifications for wiki pages 2016-04-20 08:25:40 +08:00
members
network
project_services formatting and test structure 2016-04-20 08:25:41 +08:00
.gitkeep
ability.rb Fix documentation and improve permissions code 2016-04-18 11:12:28 -03:00
abuse_report.rb
appearance.rb
application_setting.rb
audit_event.rb
blob.rb Properly handle bigger files 2016-04-28 21:28:39 +02:00
broadcast_message.rb
commit.rb Merge branch 'ci-commit-as-pipeline' into 'master' 2016-04-21 08:10:37 +00:00
commit_range.rb
commit_status.rb Fix tests 2016-04-18 07:35:43 -04:00
deploy_key.rb
deploy_keys_project.rb
email.rb
event.rb Throttle the update of project.last_activity_at to 1 minute 2016-04-25 17:25:46 +02:00
external_issue.rb Merge branch 'master' into number_sign_for_external_issue_ref 2016-04-17 18:17:27 +02:00
forked_project_link.rb
generic_commit_status.rb
global_label.rb
global_milestone.rb
group.rb Remove useless require 'file_size_validator' causing warnings 2016-04-19 11:40:16 +02:00
identity.rb
issue.rb Move Issue scopes from Issuable to Issue model 2016-04-20 15:43:32 -04:00
jira_issue.rb
key.rb
label.rb Label text color comes from JSON 2016-04-20 17:00:12 +01:00
label_link.rb
lfs_object.rb
lfs_objects_project.rb
member.rb
merge_request.rb Merge branch 'ci-commit-as-pipeline' into 'master' 2016-04-21 08:10:37 +00:00
merge_request_diff.rb Get rid of more requires, which causes warnings when code is reloaded 2016-04-19 11:48:10 +02:00
milestone.rb
namespace.rb
note.rb Remove useless require 'file_size_validator' causing warnings 2016-04-19 11:40:16 +02:00
notification_setting.rb
oauth_access_token.rb Add spec for deletion of authorized OAuth2 application 2016-04-14 07:24:58 -07:00
personal_snippet.rb
project.rb Support supressing text file diffs on the default branch with .gitattributes 2016-04-29 12:45:15 +01:00
project_group_link.rb
project_import_data.rb Remove useless require 'file_size_validator' causing warnings 2016-04-19 11:40:16 +02:00
project_snippet.rb
project_team.rb
project_wiki.rb
protected_branch.rb
release.rb
repository.rb Support supressing text file diffs on the default branch with .gitattributes 2016-04-29 12:45:15 +01:00
security_event.rb
sent_notification.rb
service.rb add slack notifications for wiki pages 2016-04-20 08:25:40 +08:00
snippet.rb Properly handle bigger files 2016-04-28 21:28:39 +02:00
spam_log.rb
spam_report.rb
subscription.rb
todo.rb
tree.rb
user.rb Remove the Devise Async gem. 2016-04-26 10:41:48 -06:00
users_star_project.rb
wiki_page.rb add slack notifications for wiki pages 2016-04-20 08:25:40 +08:00