SimpleGit - not working at all
Richard Walker (2090) 431 posts |
OK, so from the Menu module thread… I used PackMan to install SimpleGit. If I do: sgit config --global user.name "Richard Walker" I get: libgit error (2): failed to stat '/SDFS::RISCOSpi.$.!BOOT.Choices/.gitconfig': Input/output error Messing about with UnixEnv$sgit$suffix does not help. Also killing DDEUtils doesn’t help. Is anyone using SimpleGit? |
Simon Willcocks (1499) 513 posts |
I got it to work last year. https://www.riscosopen.org/forum/forums/11/topics/17499 |
Richard Walker (2090) 431 posts |
Hmm… I suspect I will be able to get some files OK (but I will try that, probably on something smaller!). I am stuck at the local configuration, which I want to get right, as I need to be able to commit/push with ROOLs gitlab. |
Richard Walker (2090) 431 posts |
Ah-ha… just about to try that, and made a minor revelation. First things first: can I initialise a new git repo? *dir dev *cdir gittest *dir gittest *sgit init Initialized empty Git repository in /SDFS::RISCOSpi.$/dev/gittest/.git All good. Then I tried my global config thing again: *sgit config --global user.name "Richard Walker" libgit error (2): failed to stat '/SDFS::RISCOSpi.$.!BOOT.Choices/.gitconfig': Input/output error Now… notice the subtle difference in the file paths. Looks like there are some dots around !BOOT where there should perhaps be slashes? The joys of filename conversions and unix compatibility etc.! So I tried this evil hack: *show choices$write Choices$Write : SDFS::RISCOSpi.$.!BOOT.Choices *set Choices$Write SDFS::RISCOSpi.$/!BOOT/Choices *show choices$write Choices$Write : SDFS::RISCOSpi.$/!BOOT/Choices *sgit config --global user.name "Richard Walker" And upon examining my Choices directory, I see a ‘/gitconfig’ file with my name inside. Hurrah. Obviously, me setting the Choices$Write variable like that is insane, and will cause all sorts of stuff to fail. But it shows where the issue is: something is not properly converting paths when they are taken from system variables. The good news is that, regardless of my Choices abuse, a clone works as it should: <notextile> *sgit clone <a href="https://github.com/riscos-richard/usbjoystick.git">https://github.com/riscos-richard/usbjoystick.git</a> gittest3 net 100% ( 141 kb, 74/ 74) / idx 100% ( 74/ 74) / chk 100% ( 56/ 56) </notextile> |
Richard Walker (2090) 431 posts |
Just to check reading from the global config, that also fails unless I hack Choices$Write in the same way: *set Choices$Write SDFS::RISCOSpi.$.!BOOT.Choices *sgit config --global user.name libgit error (7): config value 'user.name' was not found * *set Choices$Write SDFS::RISCOSpi.$/!BOOT/Choices *sgit config --global user.name Richard Walker * So it’s ‘only’ an issue in the evaluation of Choices$Write. Is this likely to be a wider issue than SimpleGit? Could other apps ported with the same bits of tech have the same issue? Of course, if I’d just configured the user name and email per-repo, rather than get these mighty ideas about global configuration, then maybe everything would have ‘just worked’ for me?! Anyway, next step is to see how I can use credentials (SSH keys) to push changes to remote repo. |
Cameron Cawley (3514) 157 posts |
I suspect the problem lies here: http://www.riscos.info/websvn/filedetails.php?repname=gccsdk&path=%2Ftrunk%2Fautobuilder%2Flibraries%2Flibgit2%2Fsysdir.c.p To elaborate, the code appears to be expanding the environment variable in the function to get the configuration directory, which then gets added to by code that assumes Unix-style paths. Other UnixLib applications would typically return “/<Choices$Write>” as the path to the configuration directory, and the environment variable wouldn’t be expanded until after the complete path is converted to RISC OS conventions. As an aside, Choices$Write is set to “Boot:Choices” by default for me, which avoids this problem. Is your machine using a different default? |
Richard Walker (2090) 431 posts |
Ahh… that code could well be the issue. Interesting that it’s in libgit2, rather than something shared. I don’t understand how your Choices$Write can look like that! You might have Boot$Path pointing to multiple locations. I have not done anything unusual. It’s a stock nightly HardDisc4 and ROM image from a month or so ago. |
Cameron Cawley (3514) 157 posts |
It looks like this is a side effect of this recent commit, which affects nightly builds but not RISC OS 5.28.
|
Richard Walker (2090) 431 posts |
Ugh. Ghastly how we cannot see BASIC diffs in the GitLab UI. I suspect the change above is legal in terms of following rules, but some existing code clearly doesn’t like it. Oops. |
Steve Fryatt (216) 2105 posts |
Raw BASIC is a binary file and Git1 treats it as such, so you would need to store the BASIC as text and tokenise it at build time for that. The RISC OS sources do that quite a bit (see things like Printers and Maestro), but clearly not in this case. 1 And Subversion, and probably most other VCSs. |