aim icon indicating copy to clipboard operation
aim copied to clipboard

Collecting git info fails when no `origin` remote is configured

Open timokau opened this issue 3 years ago • 1 comments

🐛 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

timokau avatar Jun 15 '22 11:06 timokau

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?

mihran113 avatar Aug 25 '22 16:08 mihran113

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.

gorarakelyan avatar Sep 29 '22 09:09 gorarakelyan

Sorry for the late response. I can confirm that this is fixed. Thanks!

timokau avatar Dec 08 '22 16:12 timokau