[Fix] grammar HTTPS cloning, install.sh broken pipe on fzf/ripgrep, Windows line endings - #3
Merged
Merged
Conversation
- Created a `.gitattributes` file to ensure consistent line endings across different operating systems, helping prevent issues with line ending discrepancies by automatically setting end-of-line (eol) to LF for text files - It improves collaboration by ensuring that all contributors work with the same text file formats
- Enhanced the error handling in `latest_tag()` by capturing the result of the API call into a variable for more reliable execution - Improved code readability and maintainability by separating logic into distinct steps, helping prevent errors during the tag fetching process, ensuring smoother execution of install scripts
- Switched from SSH URLs to HTTPS URLs for cloning the tree-sitter grammars, improving the accessibility and avoiding issues for users without SSH configuration - Changing the URLs to HTTPS ensures users can clone repositories regardless of their SSH settings
Rather than only swapping SSH for HTTPS, attempt both protocols for each org (grammars first, then upstream tree-sitter), so a clone succeeds whether the user has HTTPS access, an SSH key, or one is blocked by a firewall. Whichever works first wins.
halicea
reviewed
Jun 21, 2026
halicea
left a comment
Contributor
There was a problem hiding this comment.
I'll just post one more change here for a https->ssh fallback.
halicea
approved these changes
Jun 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Three independent bugs that together prevent a clean install on Linux
(especially from Windows/WSL), fixed and tested end-to-end.
Bug 1 —
tsiclones grammars over SSH, failing for most usersFile:
ts/ts_lang_install.cGrammar installation used
git@github.com:SSH URLs, which require aGitHub SSH key to be configured. This fails silently for any user who
hasn't set one up (the majority of users, and all fresh environments).
Public repos like tree-sitter grammars don't need SSH, HTTPS works
without any credentials.
Fix: Replaced
git@github.com:withhttps://github.com/in bothclone URL templates.
Tested: Ran

tsi pythonwith the newly built binary and confirmedthe clone line reads
https://with no authentication required:Bug 2 —
install.shfails to installfzfandripgrepFile:
install.shThe
latest_tag()function pipedcurldirectly intogrep -m1:grep -m1exits after the first match, closing its end of the pipewhile curl is still downloading. Curl then fails with exit code 23
("Failure writing output to destination"). Because the script runs
under
set -euo pipefail, this kills the entire function, andfzf/ripgrep never install.
Fix: Capture the full response into a variable first, then grep
through it. Curl completes before grep ever runs, so no broken pipe:
Tested: Confirmed fzf and ripgrep download and install successfully:

Bug 3 — Windows line endings break the build and install script
File:
.gitattributes(added)The repo had no
.gitattributes, so Windows users cloning it received\r\nline endings across all files. This caused:install.sh→/usr/bin/env: 'bash\r': No such file or directorycompile_flags.txt→ GCC received flags with trailing\r, producingerrors like
'; did you mean '-Wall'?.c,.h, andmakefilefiles were similarly affectedFix: Added
.gitattributesenforcing LF for all files:* text=auto eol=lfTested: Verified clean build with


makeafter line ending conversionon a Windows-cloned copy of the repo:
...
successful wihtout errors