Skip to content

ttx_diff: exclude query from the git clone url#1563

Merged
rsheeter merged 1 commit into
mainfrom
fix-clone-with-sha
Jul 17, 2025
Merged

ttx_diff: exclude query from the git clone url#1563
rsheeter merged 1 commit into
mainfrom
fix-clone-with-sha

Conversation

@anthrotype

Copy link
Copy Markdown
Member

If I copy and run one of fontc_crater's reproducer commands I get the following error when the url contains a query (? followed by the commit sha):

$ python resources/scripts/ttx_diff.py 'https://github.com/JulietaUla/Montserrat?cc8daf2e70#sources/Montserrat-Italic.glyphs'
https://github.com/JulietaUla/Montserrat?cc8daf2e70#sources/Montserrat-Italic.glyphs
Running git clone https://github.com/JulietaUla/Montserrat?cc8daf2e70 in /Users/clupo/.fontc_crater_cache/JulietaUla
Cloning into 'Montserrat?cc8daf2e70'...
fatal: https://github.com/JulietaUla/Montserrat?cc8daf2e70/info/refs not valid: is this a git repository?
Traceback (most recent call last):
  File "/Users/clupo/oss/fontc/resources/scripts/ttx_diff.py", line 1320, in <module>
    app.run(main)
    ~~~~~~~^^^^^^
  File "/Users/clupo/oss/fontc/.venv313/lib/python3.13/site-packages/absl/app.py", line 316, in run
    _run_main(main, args)
    ~~~~~~~~~^^^^^^^^^^^^
  File "/Users/clupo/oss/fontc/.venv313/lib/python3.13/site-packages/absl/app.py", line 261, in _run_main
    sys.exit(main(argv))
             ~~~~^^^^^^
  File "/Users/clupo/oss/fontc/resources/scripts/ttx_diff.py", line 1240, in main
    source = resolve_source(argv[1]).resolve()
             ~~~~~~~~~~~~~~^^^^^^^^^
  File "/Users/clupo/oss/fontc/resources/scripts/ttx_diff.py", line 1169, in resolve_source
    subprocess.run(cmd, cwd=local_repo.parent, check=True)
    ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/python@3.13/3.13.0_1/Frameworks/Python.framework/Versions/3.13/lib/python3.13/subprocess.py", line 577, in run
    raise CalledProcessError(retcode, process.args,
                             output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '('git', 'clone', 'https://github.com/JulietaUla/Montserrat?cc8daf2e70')' returned non-zero exit status 128.

This seems to fix it for me

@cmyr cmyr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

looks good!

@rsheeter rsheeter added this pull request to the merge queue Jul 17, 2025
@rsheeter

Copy link
Copy Markdown
Contributor

Took the liberty of merging because it's frustrating when this doesn't work.

Merged via the queue into main with commit 1d6b4ff Jul 17, 2025
12 checks passed
@rsheeter rsheeter deleted the fix-clone-with-sha branch July 17, 2025 00:23
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.

3 participants