Skip to content

Git index fixes#1071

Merged
ashinn merged 5 commits intoashinn:masterfrom
Retropikzel:git-index-fixes
Jan 10, 2026
Merged

Git index fixes#1071
ashinn merged 5 commits intoashinn:masterfrom
Retropikzel:git-index-fixes

Conversation

@Retropikzel
Copy link
Contributor

Github repos did not index correctly before, this fixes it.

(let* ((uri (string->uri (cadr url-pair)))
(let* ((uri-str (let ((uri (cadr url-pair)))
(if (string=? (string-copy uri 0 4) "git@")
(string-append "ssh://"
Copy link
Owner

Choose a reason for hiding this comment

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

So git@foo becomes ssh://foo but ssh://git@foo stays the same?

I think we want to drop the git@ iff using https.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The default is to make the url https url unless --use-ssh-url argument is passed. The git@foo is ssh url so it should be transformed into https or left alone. I tried to be clever and thought adding ssh:// infront before the previous fixing would be enough.

So yes you are right, thank you. I'll fix it.

@Retropikzel
Copy link
Contributor Author

--use-ssh-url? flag seems not to work. Repo I use for testing https://github.com/Retropikzel/snow-chibi-testing

make package
snow-chibi git-index --use-ssh-url? t foo-bar-10.3.tgz

Gives:

snow-chibi git-index --use-ssh-url? t foo-bar-1.0.3.tgz
ERROR on line 246 of file /usr/local/share/chibi/chibi/app.scm: car: not a pair: use-ssh-url
  called from <anonymous> on line 279 of file /usr/local/share/chibi/init-7.scm
  called from lp on line 357 of file /usr/local/share/chibi/chibi/app.scm
  called from <anonymous> on line 279 of file /usr/local/share/chibi/init-7.scm
  called from any1 on line 88 of file /usr/local/share/chibi/init-7.scm
  called from <anonymous> on line 171 of file /usr/local/share/chibi/chibi/app.scm
  called from <anonymous> on line 1268 of file /usr/local/share/chibi/init-7.scm
  called from <anonymous> on line 800 of file /usr/local/share/chibi/init-7.scm
make: *** [Makefile:11: index] Error 70

Could it be related to #1068? It could very well be my code but I think it worked when I initially made this functionality.

I also tries --use-ssh-url?=t.

@Retropikzel
Copy link
Contributor Author

The problem still exists, previous commit just fixed the name to have question mark at the end.

@Retropikzel
Copy link
Contributor Author

My bad, I had specced it wrong. --use-ssh-url? is working now

(uri->string
(uri-with-scheme (string->uri url) 'ssh)))
((string-prefix? "https://" url) url)
(else (error "Could not fix repository url" url)))))))
Copy link
Owner

Choose a reason for hiding this comment

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

Probably better just to allow any other url here. Some old sites might still use http://, and there's no reason to forbid other protocols like ftp:// since we shell out to curl and it supports them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the url taken from the git repository with command git config --get remote.origin.url so I dont think there should be any other prefix than git@, https, or ssh?

The error on the else is because if there is any other url it is with high likelihood a private one, and for publishing packages presumably a public is preferred. So I'm hoping that any user who runs into this error would report it, and handling (private -> public, unless --use-ssh-url is given) for their url can be added then.

@ashinn ashinn merged commit 6686776 into ashinn:master Jan 10, 2026
2 of 3 checks passed
@Retropikzel
Copy link
Contributor Author

Thank you!

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.

2 participants