Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Support SCP-like parent URLs with relative submodules

Đang mở
#492 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
56/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
git, go
Lĩnh vực
devtools

Hướng nghiên cứu

Bắt đầu bằng cách tìm ResolveSubmoduleURL và scpLikeURLRegex hiện có. Đọc cách xử lý đường dẫn tương đối và so sánh với hành vi của transport.NewEndpoint() trong go-git, sau đó bổ sung coverage cho các URL cha dạng SCP và các đường dẫn submodule tương đối. Hoàn thành khi URL được báo cáo được phân giải mà không gặp lỗi hiện tại, đồng thời các trường hợp HTTPS hiện có và các trường hợp có nhiều đường dẫn tương đối vẫn tiếp tục hoạt động.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

envbuilder Feature

Problem

When the parent repository uses an SCP-like URL (e.g., [email protected]:org/repo.git) and a submodule is configured with a relative path (e.g., ../other/submodule.git), envbuilder cannot resolve the submodule URL.

Currently this returns an error:

relative submodule URL "../other/submodule.git" cannot be resolved: parent URL "[email protected]:org/repo.git" uses SCP-like syntax which is not supported for relative submodule resolution

Background

Go's net/url.Parse() cannot properly parse SCP-like URLs - they have no scheme and use : as a path separator instead of /.

We've built a custom ResolveSubmoduleURL function to handle relative submodule paths because go-git's native implementation has bugs with:

  • HTTPS URLs losing slashes when using filepath.Dir()
  • Multiple relative paths (../../submodule.git) not resolving correctly

Workaround

Users can configure submodules with absolute URLs instead of relative paths.

Proposed Solution

Add SCP-like URL handling to ResolveSubmoduleURL:

  1. Detect SCP-like parent URLs using the existing scpLikeURLRegex
  2. Parse into user, host, and path components
  3. Apply relative path resolution to the path component
  4. Reconstruct the SCP-like URL

Alternatively, use go-git's transport.NewEndpoint() which can parse SCP-like URLs, but this needs careful testing to ensure it doesn't reintroduce the bugs we worked around.

Related/Blocker

  • PR #485: feat: add git submodule support
Ngôn ngữ chính
Go
Star
300
Fork
64
Merge trung bình
20 phút
Pull request đã merge (30 ngày)
1

Chuẩn bị môi trường

Chúng tôi chưa kiểm tra các tệp thiết lập môi trường của dự án này. Hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của coder/envbuilder

Tất cả issue của coder/envbuilder

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.