johnmehr / gitup

A minimalist, dependency-free FreeBSD program to clone/pull Git repositories.
BSD 2-Clause "Simplified" License
50 stars 9 forks source link

0.90 can't fetch ports quarterly from git.freebsd.org #62

Closed nunotexbsd closed 3 years ago

nunotexbsd commented 3 years ago

Hello,

I'm preparing to update 0.90 freebsd port so it include move to git.freebsd.org in gitup.conf:

"defaults" : {
                "host"           : "git.freebsd.org",
                "port"           : 443,
                "verbosity"      : 1,
                "work_directory" : "/var/db/gitup",
        },

        "ports" : {
                "repository" : "/ports.git",
                "branch"     : "main",
                "target"     : "/usr/ports",
                "ignores"    : [
                        "distfiles",
                        "packages",
                ],
        },

        "quarterly" : {
                "repository" : "/ports.git",
                "branch"     : "quarterly",
                "target"     : "/usr/ports",
                "ignores"    : [
                        "distfiles",
                        "packages",
                ]
        },

gitup ports works OK gitup quarterly:

# Host: git.freebsd.org
# Port: 443
# Repository: /ports.git
# Target: /usr/ports
gitup: get_commit_details: refs/heads/branches/2021Q2 doesn't exist in /ports.git: Invalid argument

Don't know if this is a gitup problem or a git.freebsd.org problem. What do you think?

Thanks, Nuno Teixeira

michael-o commented 3 years ago

This works for me from main:

{
        "defaults" : {
                "host"           : "git.freebsd.org",
                "port"           : 443,
                "verbosity"      : 1,
                "work_directory" : "/var/db/gitup",
        },

        "ports" : {
                "repository_path"  : "/ports.git",
                "branch"           : "2021Q2",
                "target_directory" : "/usr/ports",
                "ignores"          : [
                        "distfiles",
                        "packages"
                ],
        }

}
nunotexbsd commented 3 years ago

I've tested "branch" : "2021Q2" and it works ok but "branch" : "quarterly" that points to 2021Q2 too, doesn't and gives that error.

Should I update port with "branch" : "2021Q2" instead of "branch" : "quarterly"?

michael-o commented 3 years ago

One needs to check what gitup is exactly doing here. The behavior might has changed from GitHub to FreeBSD-hosted Git repo. Offtopic: I am not a huge fan of some magic because I chose a quarterly branch deliberately and should switch to a newer as such.

Here is the reason:

003f22e399d695717c14566f60255c72aae4c8c3d08c refs/heads/2020Q2
003fc0d44897151cceb0c4e63f2f7763b030f3019b66 refs/heads/2020Q3
003fc9104cb760e6d462d2e0a768cbbf0d95968012fa refs/heads/2020Q4
003fdf5930d0c9fef97d429b0a43dad7d2168061b224 refs/heads/2021Q1
003fb02c01eca9184a8007c59abd485cb0a060b81b0f refs/heads/2021Q2

branches/ does not appear in the ref name anymore.

nunotexbsd commented 3 years ago

Thanks @michael-o for your explanation.

I will use '2021Q2' instead 'quarterly' for this update.

johnmehr commented 3 years ago

This problem should have been fixed in 0f52d593cfab2e7ef16439018232b37e8f6aa311. Is it still not working?

johnmehr commented 3 years ago

I just pushed out 0.91 and this should be fixed now. How does it look?

nunotexbsd commented 3 years ago

It is fixed in 0.91. $ gitup quarterly runs ok with gitup.conf:

"quarterly" : {
                "repository_path"  : "/ports.git",
                "branch"           : "quarterly",
                "target_directory" : "/usr/ports",
                "ignores"          : [
                        "distfiles",
                        "packages",
                        "INDEX-11",
                        "INDEX-12",
                        "INDEX-13",
                        "INDEX-14",

Thanks! Nuno Teixeira