ViperIDE
ViperIDE copied to clipboard
GitHub Repo Contents API
Following up from https://github.com/vshymanskyy/ViperIDE/issues/17#issuecomment-226719210
The idea is cool π But, i'm wondering how the sync could work. In instance, i have a GitHub repo with some files. Now, i'm connecting a device that may have a slightly (or completely) different file system. Which one is correct? Is this device even associated with the repository? Same applies to regular host filesystem access, if/when it gets implemented.
Agree that it's tricky to implement without either loading complexity on either configuration or opinionated default conventions.
As a first draft on this idea I'd probably limit it to making sure that the board is blank and then assume that the GH repo is the authoritative source of truth (SSOT). Then provide "escape hatches" for those users that already have files on the board but want to use that feature at their own risk... although moving those files to a repo first and wiping the device is not too onerous anyway?
For conflict resolution, I'd also assume that the repo changes come first and the device changes are something to resolve on the editor (via a diff/change merge view).... not trivial in any case, I agree.
Yes, it gets even more complicated if you have multiple boards running the same firmware. It could easily lead to multiple boards running different (but clean) revisions of the same repo.
π΅βπ«
Yes, it gets even more complicated if you have multiple boards running the same firmware. It could easily lead to multiple boards running different (but clean) revisions of the same repo.
π΅βπ«
In this case, wouldn't it be enough to save the HEAD git hash to disambiguate state? Or worst case, keeping the .git folder around that can later be removed when shipping to production?
No, keeping .git on the device is not gonna work
Git allows you to store the .git folder containing the repo in a different location
git init --separate-git-dir mcu_repo/repo.git mcu
not sure if wasm-git allows for that, but if so, that would allow a structure where the src files are stored on the mcu , and the checked out repo / branch on browser / local store
ββββmcu ( physical device)
ββββmcu_repo
ββββrepo.git
ββββhooks
ββββinfo
ββββlogs
β ββββrefs
β ββββheads
ββββobjects
β ββββ01
β ββββpack
ββββrefs