Skip to content

Add optional Git protocol clone URLs - #8360

Open
landeqiming666 wants to merge 1 commit into
gogs:mainfrom
landeqiming666:git-protocol-clone-url
Open

Add optional Git protocol clone URLs#8360
landeqiming666 wants to merge 1 commit into
gogs:mainfrom
landeqiming666:git-protocol-clone-url

Conversation

@landeqiming666

Copy link
Copy Markdown

Describe the pull request

This adds an optional [repository] ENABLE_GIT_PROTOCOL_CLONE setting for sites that already expose public repositories through a separately configured git daemon.

When enabled, public repository and wiki clone panels include a GIT protocol button using git://<domain>/<owner>/<repo>.git. The setting defaults to false, so existing installations do not show git:// clone URLs unless administrators explicitly enable it.

This keeps the scope to the clone URL surface and does not start, configure, or manage a git daemon.

Link to the issue: #1929

Checklist

  • I agree to follow the Code of Conduct by submitting this pull request.
  • I have read and acknowledge the Contributing guide.
  • I have added test cases to cover the new code or have provided the test plan. (if applicable)
  • I have added an entry to CHANGELOG. (if applicable)

Test plan

  • go test ./internal/conf ./internal/repox ./internal/context -count=1
  • go test ./internal/database -run Test_CreateRepository_PreventDeletion -count=1
  • node --check public/js/gogs.js
  • git diff --check

@landeqiming666
landeqiming666 requested a review from unknwon as a code owner June 10, 2026 13:01
@landeqiming666
landeqiming666 force-pushed the git-protocol-clone-url branch from 799a732 to cdfffa9 Compare July 13, 2026 04:22
@landeqiming666

Copy link
Copy Markdown
Author

Rebased onto the current main branch and re-ran the validation. go test ./internal/repox ./internal/conf -count=1, the relevant context/database tests, and node --check public/js/gogs.js pass; git diff --check also passes. This remains scoped to an opt-in git:// clone URL for sites that already provide the daemon, without changing the default.

@landeqiming666

Copy link
Copy Markdown
Author

Hi, a brief follow-up on this PR. It is rebased on the current main branch, the pull request body follows the repository template, and the focused repository/configuration plus related context and database tests pass. The change remains limited to the optional Git protocol clone URL setting. Please let me know if any further adjustment would help with review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant