astrofrog / batchpr

Package in need of a better name to automate opening pull requests :robot:
BSD 2-Clause "Simplified" License
3 stars 4 forks source link

ENH: API to query whether any real changes are made #34

Open pllim opened 3 days ago

pllim commented 3 days ago

Case study: I give it logic to do some update in batch mode. But perhaps those updates are already done in select repositories by others. In that case, my logic would still run but really results in zero diff. The current Updater does not check whether there is actually any real changes before attempting to commit.

Desired outcome: New API to return bool on whether there is any real changes done. And then use this API in the rest of the Updater to be no-op if that is the case.

Current behavior: It crashes when trying to make an empty commit: Command 'git commit -m "some message"' failed

bsipocz commented 3 days ago

One example is here: https://github.com/astropy/pytest-remotedata/pull/80

The repo has been already switched to using hashes, it was just waiting for a few more days for dependabot to update the versions. But also, some other cases may have partially updated, but decide to not use hashes for some actions, so it would be useful to notice that and manually check if partial updates are desired.