list_reports skips valid reports due to git's safe directory 'feature'
git refuses to look at repos that are not owned by the current user. there is no way to override this option at runtime without material changes to the user's global git config.
as a result, anyone that runs a command or script that depends on the cmd's lookup function cmd._report.list_reports()
, one of two things happen:
- list_reports() will skip over various valid reports and return the first valid report it's able to open, which may be the wrong report
- list_reports() will iterate through all available reports and return nothing
in case 1. above, this can result in downstream operations failing (in the best case scenario) or not failing but produce (sometimes subtley) wrong results!
we should either:
- have a hard fail anytime a report is encountered that git cannot open and ask the user to edit their config accordingly
- automatically enable safe.directory * for the user and then remove the option on exit.
also, the logging message that describes the reason a report is skipped is in debug mode, which most users don't see. we should change this to at least 'warning' for visibility.