Skip to content

Make sure that every repo URL ends in a trailing .git (except for repos hosted on Sourcehut)#150982

Draft
DilumAluthge wants to merge 3 commits intomasterfrom
dpa/convention-trailing-dotgit
Draft

Make sure that every repo URL ends in a trailing .git (except for repos hosted on Sourcehut)#150982
DilumAluthge wants to merge 3 commits intomasterfrom
dpa/convention-trailing-dotgit

Conversation

@DilumAluthge
Copy link
Member

@DilumAluthge DilumAluthge commented Mar 21, 2026

In the registry, our convention is for every repo URL to end in a trailing .git. This PR makes sure that every URL adheres to the convention. Except for repos hosted on Sourcehut (git.sr.ht), which doesn't seem to support URLs with the trailing .git.

Future work:

This PR was generated by the following Julia script:

import TOML

for (path, _, files) in walkdir(".")
    sort_order = Dict(
        "name" => 1,
        "uuid" => 2,
        "repo" => 3,
        "subdir" => 4,
        "metadata" => 5,
        "reason" => 6,
        "alternative" => 7,
    )
    by_function = key -> sort_order[key]
    for file in files
        if file == "Package.toml"
            fullpath = joinpath(path, file)
            dict = TOML.parsefile(fullpath)
            haskey(dict, "repo") || @error "" fullpath dict
            if !endswith(dict["repo"], ".git")
                dict["repo"] = dict["repo"] * ".git"
            end
            open(fullpath, "w") do io
                TOML.print(io, dict; sorted = true, by = by_function)
            end
        end
    end
end

I wrote this script by hand. No generative AI tools were used.

@DilumAluthge DilumAluthge changed the title Make sure that every repo URL ends in the trailing .git Make sure that every repo URL ends in a trailing .git Mar 21, 2026
@DilumAluthge DilumAluthge force-pushed the dpa/convention-trailing-dotgit branch from c59647f to 6a68d27 Compare March 21, 2026 00:47
@DilumAluthge DilumAluthge changed the title Make sure that every repo URL ends in a trailing .git Make sure that every repo URL ends in a trailing .git (except for repos hosted on git.sr.ht) Mar 21, 2026
@DilumAluthge DilumAluthge force-pushed the dpa/convention-trailing-dotgit branch from 6a68d27 to 5261a52 Compare March 21, 2026 00:59
@DilumAluthge DilumAluthge changed the title Make sure that every repo URL ends in a trailing .git (except for repos hosted on git.sr.ht) Make sure that every repo URL ends in a trailing .git (except for repos hosted on Sourcehut) Mar 21, 2026
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