aim
aim copied to clipboard
Collecting git info fails when no `origin` remote is configured
🐛 Bug
The get_git_info utility function tries to run 3 git commands. When any one of them fails, it reports that "Something went wrong" and gives up entirely:
https://github.com/aimhubio/aim/blob/ffd9a5f8677e2b65b7485e3e64f7cc6158787ad2/aim/ext/utils.py#L43-L57
This is probably fine for the first and the third, as they should succeed. The second one only succeeds if an origin remote is configured however. If we're running in a git repository without a remote (or with a differently named remote), get_git_info will fail to collect any info.
To reproduce
- Create a new git repository
- Within that repository, run
aim.Run(log_system_params=True). - Notice that it prints
Something went wrong while collecting git info. Will skip this step.
Expected behavior
The other components of "git info" should be logged independent of the origin. Ideally it would also be nice to avoid hardcoding the name of the remote, but that is less important.
Environment
- Aim Version 3.10.1
- Python version 3.10
- pip version N/A
- OS (e.g., Linux) Linux
- Any other relevant information
Hey @timokau. The fix for this issue has been shipped with aim v3.13.0.
Could you please check it out to see if everything works as expected?
Closing this issue, as it has been shipped. @timokau pls feel free to reopen this if there are still any issues with collecting git info.
Sorry for the late response. I can confirm that this is fixed. Thanks!