Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide option to unlink a fork #11858

Merged
merged 9 commits into from
Jul 2, 2020

Conversation

zeripath
Copy link
Contributor

Provides a setting option to unlink a fork from its base repository.

Fix #4566

Signed-off-by: Andrew Thornton art27@cantab.net

Fix go-gitea#4566

Signed-off-by: Andrew Thornton <art27@cantab.net>
@zeripath zeripath added the type/feature Completely new functionality. Can only be merged if feature freeze is not active. label Jun 11, 2020
@zeripath zeripath added this to the 1.13.0 milestone Jun 11, 2020
options/locale/locale_en-US.ini Outdated Show resolved Hide resolved
options/locale/locale_en-US.ini Outdated Show resolved Hide resolved
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Jun 11, 2020
@CirnoT
Copy link
Contributor

CirnoT commented Jun 11, 2020

I don't think we should push it before we have a way to limit forks user can create, otherwise all instances will suffer from repository limit being broken

Co-authored-by: techknowlogick <matti@mdranta.net>
@zeripath
Copy link
Contributor Author

zeripath commented Jun 11, 2020

We already have a convert mirror which I think also gets round the repo counts.

But in any case I had forgotten about the repo counts - I guess we can prevent the conversion if they're at the limit.

log.ColorFprintf(s, "%d:%s/%s",
log.NewColoredIDValue(repo.ID),
ownerName,
repo.OwnerName,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This set of changes just tidies up this function since we changed to always store the OwnerName

@zeripath
Copy link
Contributor Author

@CirnoT This will now check if you can create repos before transferring.

@CirnoT
Copy link
Contributor

CirnoT commented Jun 13, 2020

That should be fine then

@CirnoT
Copy link
Contributor

CirnoT commented Jun 15, 2020

Index: web_src/less/_repository.less
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- web_src/less/_repository.less	(revision cce3f9f6fccbcd4dbcadc28c605ef334e74f9baf)
+++ web_src/less/_repository.less	(date 1592203778992)
@@ -2744,7 +2744,10 @@
 }
 
 #transfer-repo-modal,
-#delete-repo-modal {
+#delete-repo-modal,
+#delete-wiki-modal,
+#convert-fork-repo-modal,
+#convert-mirror-repo-modal {
     .ui.message {
         width: 100% !important;
     }
Index: templates/repo/settings/options.tmpl
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- templates/repo/settings/options.tmpl	(revision cce3f9f6fccbcd4dbcadc28c605ef334e74f9baf)
+++ templates/repo/settings/options.tmpl	(date 1592203778999)
@@ -360,7 +360,7 @@
 			{{if .Repository.IsMirror}}
 				<div class="item">
 					<div class="ui right">
-						<button class="ui basic red show-modal button" data-modal="#convert-repo-modal">{{.i18n.Tr "repo.settings.convert"}}</button>
+						<button class="ui basic red show-modal button" data-modal="#convert-mirror-repo-modal">{{.i18n.Tr "repo.settings.convert"}}</button>
 					</div>
 					<div>
 						<h5>{{.i18n.Tr "repo.settings.convert"}}</h5>
@@ -448,7 +448,7 @@
 
 {{if .Permission.IsOwner}}
 	{{if .Repository.IsMirror}}
-		<div class="ui small modal" id="convert-repo-modal">
+		<div class="ui small modal" id="convert-mirror-repo-modal">
 			<div class="header">
 				{{.i18n.Tr "repo.settings.convert"}}
 			</div>

@CirnoT
Copy link
Contributor

CirnoT commented Jun 15, 2020

Seems good otherwise

@GiteaBot GiteaBot added lgtm/need 1 This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. labels Jun 15, 2020
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Jun 24, 2020
@zeripath
Copy link
Contributor Author

zeripath commented Jul 2, 2020

make lg-tm work

@zeripath zeripath merged commit 482ba93 into go-gitea:master Jul 2, 2020
@zeripath zeripath deleted the fix-4566-unlink-fork branch July 2, 2020 14:09
ydelafollye pushed a commit to ydelafollye/gitea that referenced this pull request Jul 31, 2020
* Provide option to unlink a fork

Fix go-gitea#4566

Signed-off-by: Andrew Thornton <art27@cantab.net>

* Apply suggestions from code review

Co-authored-by: techknowlogick <matti@mdranta.net>

* Add check that user can create repo

Signed-off-by: Andrew Thornton <art27@cantab.net>

* as per @CirnoT

Signed-off-by: Andrew Thornton <art27@cantab.net>

Co-authored-by: techknowlogick <matti@mdranta.net>
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/feature Completely new functionality. Can only be merged if feature freeze is not active.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make fork independent from original repository
6 participants