bicycledata / bicycleinit

MIT License
0 stars 1 forks source link

Init Script Ends in Infinite Loop When Local Repository is Ahead of Remote #4

Open lochel opened 1 month ago

lochel commented 1 month ago

Description: The init script currently enters an infinite loop if the local repository is ahead of the remote repository. While this scenario shouldn't occur under normal circumstances, it's possible that it might happen at some point. To ensure robustness, the script should be able to handle this situation gracefully.

Steps to Reproduce:

  1. Set up a local repository that is ahead of the remote (e.g., by making an empty commit without pushing it).
  2. Run the init script.

Expected Behavior: The script should detect that the local repository is ahead of the remote and handle it appropriately.

Actual Behavior: The script enters an infinite loop, requiring manual intervention to stop it.

Additional Context: Although this situation shouldn't normally happen, it's better to be proactive and handle it now rather than risk the script failing unexpectedly in the future.

jsliacan commented 1 month ago

If the hashes don't match, regardless of ahead or behind or not even on the same branch :-).

lochel commented 1 month ago

Behind shouldn't be a problem, but diverged and ahead (which is arguably the same as diverged) causes problems right now.

This isn't much of a problem, because the cloned repository on the devices (boxes) should never be touched. But for the dev environment it is a bit of a pain.