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

Add support for HEAD ref in /src/branch and /src/commit routes #27384

Merged
merged 2 commits into from Oct 3, 2023

Conversation

rbhz
Copy link
Contributor

@rbhz rbhz commented Oct 1, 2023

Add support for HEAD in paths:

/src/branch/HEAD/README.md
/src/commit/HEAD/README.md

Closes #26920

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Oct 1, 2023
@pull-request-size pull-request-size bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Oct 1, 2023
@lunny lunny added this to the 1.22.0 milestone Oct 2, 2023
@lunny lunny added the type/enhancement An improvement of existing functionality label Oct 2, 2023
@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 2, 2023
@wxiaoguang
Copy link
Contributor

It looks strange.

  1. Why both /src/branch and /src/commit are changed? If I understand correctly, only one change is enough
  2. Using HEAD is unclear. It conflicts with git's HEAD concept. I would suggest to use /src/branch-default/... or /src/commit/default-branch/...

@lunny
Copy link
Member

lunny commented Oct 2, 2023

It looks strange.

1. Why both `/src/branch` and `/src/commit` are changed? If I understand correctly, only one change is enough

2. Using `HEAD` is unclear. It conflicts with git's HEAD concept. I would suggest to use `/src/branch-default/...` or `/src/commit/default-branch/...`

It's following Github's routes which is using HEAD.

@wxiaoguang
Copy link
Contributor

It's following Github's routes which is using HEAD.

Thanks, I read through #26920 again, and I can see some details have been discussed there.

Since GitHub has used HEAD for default branch, then I guess it's fine to follow.

@silverwind
Copy link
Member

Maybe we should also migrate to single /blob/ routes later, can keep the current ones intact. Of course not in scope for this PR.

Copy link
Member

@silverwind silverwind left a comment

Choose a reason for hiding this comment

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

Works nicely.

@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 2, 2023
@silverwind silverwind added the backport/v1.21 This PR should be backported to Gitea 1.21 label Oct 2, 2023
@lunny lunny added the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Oct 3, 2023
@lunny lunny enabled auto-merge (squash) October 3, 2023 02:27
@lunny lunny merged commit 2b06c10 into go-gitea:main Oct 3, 2023
26 checks passed
GiteaBot pushed a commit to GiteaBot/gitea that referenced this pull request Oct 3, 2023
…tea#27384)

Add support for HEAD in paths:
```
/src/branch/HEAD/README.md
/src/commit/HEAD/README.md
```

Closes go-gitea#26920
@GiteaBot GiteaBot removed the reviewed/wait-merge This pull request is part of the merge queue. It will be merged soon. label Oct 3, 2023
@GiteaBot GiteaBot added the backport/done All backports for this PR have been created label Oct 3, 2023
lunny pushed a commit that referenced this pull request Oct 3, 2023
… (#27407)

Backport #27384 by @rbhz

Add support for HEAD in paths:
```
/src/branch/HEAD/README.md
/src/commit/HEAD/README.md
```

Closes #26920

Co-authored-by: Kirill Sorokin <48334247+rbhz@users.noreply.github.com>
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Jan 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/done All backports for this PR have been created backport/v1.21 This PR should be backported to Gitea 1.21 lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. type/enhancement An improvement of existing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Path to receive content from a repository's default branch
5 participants