pytmc template needs some version control information to annotate the st.cmd file.
If this is run in a case where there is no git information, the code as-written hits an infinite loop and runs forever.
This function is a while loop that continually checks the parent directory if it has not yet found a .git directory.
Unfortunately, there is no termination for this loop in the case of no .git directories at all, and also unfortunately, the parent of the root directory in pathlib is the root directory again, so this loop quickly reaches the point where it is repeatedly stat-ing for /.git on the filesystem infinitely.
To resolve, this should either raise an error or have fallback behavior for cases with no git repository information.
pytmc template
needs some version control information to annotate the st.cmd file. If this is run in a case where there is no git information, the code as-written hits an infinite loop and runs forever.This infinite loop happens in
find_git_root
at https://github.com/pcdshub/pytmc/blob/2c4f4121cd109d2d2cee9bdcc357d792ddca01f7/pytmc/bin/template.py#L130-L135This function is a while loop that continually checks the parent directory if it has not yet found a .git directory. Unfortunately, there is no termination for this loop in the case of no .git directories at all, and also unfortunately, the parent of the root directory in pathlib is the root directory again, so this loop quickly reaches the point where it is repeatedly stat-ing for
/.git
on the filesystem infinitely.To resolve, this should either raise an error or have fallback behavior for cases with no git repository information.