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

Allow agit -o force-push work like -o force-push=true #32239

Closed
wants to merge 4 commits into from

Conversation

lunny
Copy link
Member

@lunny lunny commented Oct 11, 2024

@lunny lunny added the type/enhancement An improvement of existing functionality label Oct 11, 2024
@lunny lunny added this to the 1.23.0 milestone Oct 11, 2024
@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Oct 11, 2024
@pull-request-size pull-request-size bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Oct 11, 2024
@github-actions github-actions bot added the modifies/go Pull requests that update Go code label Oct 11, 2024
services/agit/agit.go Outdated Show resolved Hide resolved
services/agit/agit.go Outdated Show resolved Hide resolved
Co-authored-by: 6543 <6543@obermui.de>
@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 Oct 11, 2024
@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 Oct 12, 2024
@lunny lunny added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Oct 12, 2024
@lunny lunny enabled auto-merge (squash) October 12, 2024 00:47
@wxiaoguang wxiaoguang removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Oct 12, 2024
@wxiaoguang
Copy link
Contributor

The code should be re-used, and other options should also use the better behavior.

And new code (at least GitPushOptions.Bool) should be tested.

image

@lunny
Copy link
Member Author

lunny commented Oct 12, 2024

The code should be re-used, and other options should also use the better behavior.

And new code (at least GitPushOptions.Bool) should be tested.

image

I don't think we can use GitPushOptions.Bool here because -o force-push will get false but we think it should be true.

@wxiaoguang
Copy link
Contributor

The code should be re-used, and other options should also use the better behavior.
And new code (at least GitPushOptions.Bool) should be tested.

I don't think we can use GitPushOptions.Bool here because -o force-push will get false but we think it should be true.

The code should be re-used, and other options should also use the better behavior.

GitPushOptions.Bool should be improved but not introducing more unmaintainable code.

@wxiaoguang
Copy link
Contributor

And one more question, how does -o force-push work? In code, I could only find if len(kv) == 2 { hookOptions.GitPushOptions[kv[0]] = kv[1] }

So, how could force-push be put into GitPushOptions?

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Oct 12, 2024

I don't think we can use GitPushOptions.Bool here because -o force-push will get false but we think it should be true.

And one more question, if you make -o force-push work (new behavior), then what -o repo.private should mean? Should it still mean "repo.private" option exists but its value is false and the repo should be made as public (the old behavior)?

That's a messy design.

@lunny lunny closed this Oct 12, 2024
@lunny lunny deleted the lunny/allow_agit_force_push branch October 12, 2024 03:06
@wxiaoguang
Copy link
Contributor

I will write a correct one.

@lunny lunny removed this from the 1.23.0 milestone Oct 12, 2024
@wxiaoguang
Copy link
Contributor

-> Make git push options accept short name #32245

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/go Pull requests that update Go code size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

agit flow hook refuses forced pushes
5 participants