26 March 2021

I’ve started working on a small Go tool to quickly add bookmarks to this site from the command line. This Blot.im site uses Git as the sync engine, so in order to publish the updates, the tool will need to add the changed files to Git, commit the changes, and push them to Blot.im. It does this by shelling out” to the Git command line using the exec package.

For some reason, whenever the tool tries to run git add with the updated files, the error code that is returned is 128. Since the error code is not zero, the tool interprets this as an error and terminates the program. As far as I can tell, the files are being added to the repository without any issues. When I run the command from the terminal, it seems to work correctly, and the returning error code is zero. I do know some shells actually add something to the error code when they succeed properly, which may explain this odd behaviour.

Interestingly, this doesn’t happen with the other tool that I’ve written to quickly write and publish posts for this site. This one shells out to Git in the same way, and I have had zero trouble with it doing so. The only reason for this discrepancy that I can think of is that this other tool is written in Swift, and there might be some difference in how Core Foundation interprets error codes.

I guess further investigation is warranted.


Previous post
Google Still Don’t Understand Services It’s been a little while since I’ve though of Steve Yeggie’s platform rant on the the state of Google’s services. But spending a few hours exploring
Next post
Versioning and dependency management is hard Up there with naming, caching, concurrency, and off by one errors, I think versioning and dependency management are two aspects of software