Commit e89cc386 authored by Nick Thomas's avatar Nick Thomas

Merge branch 'reduce-repo-size' into 'master'

Update reduce repo size docs to use `git filter-repo`

Closes #33472 and #219718

See merge request gitlab-org/gitlab!33576
parents 7d9ad1b8 f582d718
...@@ -284,8 +284,8 @@ module ProjectsHelper ...@@ -284,8 +284,8 @@ module ProjectsHelper
"xcode://clone?repo=#{CGI.escape(default_url_to_repo(project))}" "xcode://clone?repo=#{CGI.escape(default_url_to_repo(project))}"
end end
def link_to_bfg def link_to_filter_repo
link_to 'BFG', 'https://rtyley.github.io/bfg-repo-cleaner/', target: '_blank', rel: 'noopener noreferrer' link_to 'git filter-repo', 'https://github.com/newren/git-filter-repo', target: '_blank', rel: 'noopener noreferrer'
end end
def explore_projects_tab? def explore_projects_tab?
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
%button.btn.js-settings-toggle %button.btn.js-settings-toggle
= expanded ? _('Collapse') : _('Expand') = expanded ? _('Collapse') : _('Expand')
%p %p
= _("Clean up after running %{bfg} on the repository" % { bfg: link_to_bfg }).html_safe = _("Clean up after running %{filter_repo} on the repository" % { filter_repo: link_to_filter_repo }).html_safe
= link_to icon('question-circle'), = link_to icon('question-circle'),
help_page_path('user/project/repository/reducing_the_repo_size_using_git.md'), help_page_path('user/project/repository/reducing_the_repo_size_using_git.md'),
target: '_blank', rel: 'noopener noreferrer' target: '_blank', rel: 'noopener noreferrer'
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
= _("Choose a file") = _("Choose a file")
%span.prepend-left-default.js-filename %span.prepend-left-default.js-filename
= _("No file selected") = _("No file selected")
= f.file_field :bfg_object_map, accept: 'text/plain', class: "hidden js-object-map-input", required: true = f.file_field :bfg_object_map, class: "hidden js-object-map-input", required: true
.form-text.text-muted .form-text.text-muted
= _("The maximum file size allowed is %{size}.") % { size: number_to_human_size(Gitlab::CurrentSettings.max_attachment_size.megabytes) } = _("The maximum file size allowed is %{size}.") % { size: number_to_human_size(Gitlab::CurrentSettings.max_attachment_size.megabytes) }
= f.submit _('Start cleanup'), class: 'btn btn-success' = f.submit _('Start cleanup'), class: 'btn btn-success'
......
---
title: Add support for `git filter-repo` to repository cleanup
merge_request: 33576
author:
type: added
...@@ -97,7 +97,7 @@ Read the documentation on how to [migrate an existing Git repo with Git LFS](mig ...@@ -97,7 +97,7 @@ Read the documentation on how to [migrate an existing Git repo with Git LFS](mig
To remove objects from LFS: To remove objects from LFS:
1. Use [BFG-Cleaner](../../../user/project/repository/reducing_the_repo_size_using_git.md#using-the-bfg-repo-cleaner) or [filter-branch](../../../user/project/repository/reducing_the_repo_size_using_git.md#using-git-filter-branch) to remove the objects from the repository. 1. Use [`git filter-repo`](../../../user/project/repository/reducing_the_repo_size_using_git.md) to remove the objects from the repository.
1. Delete the relevant LFS lines for the objects you have removed from your `.gitattributes` file and commit those changes. 1. Delete the relevant LFS lines for the objects you have removed from your `.gitattributes` file and commit those changes.
## File Locking ## File Locking
......
...@@ -685,11 +685,11 @@ describe ProjectsHelper do ...@@ -685,11 +685,11 @@ describe ProjectsHelper do
end end
end end
describe 'link_to_bfg' do describe 'link_to_filter_repo' do
subject { helper.link_to_bfg } subject { helper.link_to_filter_repo }
it 'generates a hardcoded link to the BFG Repo-Cleaner' do it 'generates a hardcoded link to git filter-repo' do
result = helper.link_to_bfg result = helper.link_to_filter_repo
doc = Nokogiri::HTML.fragment(result) doc = Nokogiri::HTML.fragment(result)
expect(doc.children.size).to eq(1) expect(doc.children.size).to eq(1)
...@@ -702,8 +702,8 @@ describe ProjectsHelper do ...@@ -702,8 +702,8 @@ describe ProjectsHelper do
expect(link.name).to eq('a') expect(link.name).to eq('a')
expect(link[:target]).to eq('_blank') expect(link[:target]).to eq('_blank')
expect(link[:rel]).to eq('noopener noreferrer') expect(link[:rel]).to eq('noopener noreferrer')
expect(link[:href]).to eq('https://rtyley.github.io/bfg-repo-cleaner/') expect(link[:href]).to eq('https://github.com/newren/git-filter-repo')
expect(link.inner_html).to eq('BFG') expect(link.inner_html).to eq('git filter-repo')
expect(result).to be_html_safe expect(result).to be_html_safe
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment