pcal43 / fastback

Fast, incremental Minecraft world backups. Powered by Git.
https://pcal43.github.io/fastback/
GNU General Public License v2.0
133 stars 20 forks source link

maintain world git config via template, including disablement option, including disabling gpgkey by default #165

Closed MeeniMc closed 1 year ago

MeeniMc commented 2 years ago

I need to have gitconfig contain the following option for other projects, but that conflicts with using fastback on that same computer

.gitconfig:

[commit]
  gpgsign = true

This causes the following error (backup is staged, but not committed).

[11:10:07] [Server thread/INFO]: Starting backup
[11:10:07] [pool-3-thread-4/INFO]: Preparing local backup snapshots/514682d2-7ad6-4bf9-bbae-49044e2fa786/2022-10-24_11-10-07
[11:10:08] [pool-3-thread-4/INFO]: Disabling world save for 'git add'
[11:10:08] [pool-3-thread-4/INFO]: Adding 755 new or modified files to index
[11:10:15] [pool-3-thread-4/INFO]: World save re-enabled.
[11:10:15] [pool-3-thread-4/ERROR]: Command execution failed.
org.eclipse.jgit.api.errors.ServiceUnavailableException: Signing service is not available
    at org.eclipse.jgit.api.CommitCommand.sign(CommitCommand.java:328) ~[org_eclipse_jgit_org_eclipse_jgi206071550-r-f0955f5ce674565a.jar:?]

Ideally, gpgsign should be ignored automatically (since there is really no point in signing the backups, and using the signature may require interactive password input)

pcal43 commented 2 years ago

Seems to me the solution here is to either

MeeniMc commented 2 years ago

Solution 2 is workable, but why not having this set by default when the repo is created on the first backup?

pcal43 commented 2 years ago

Couple reasons

So, I dunno. I do plan to add a default config that follows a similar strategy to .gitignore (maintained by the tool with configurable disablement of updates for advanced users). I suppose there's not a lot of harm in adding gpgsign = false to it. But I am wary of a slippery slope here.

jan-Sanku commented 1 year ago

I'd like to bump this. While it's true that users who know what a git config is will be able to figure it out eventually, this should still be worked on, because it leaves the repo in a weird state (reading the author's message, apparently it's staged but not committed?)

I personally couldn't come up with a way of fixing it, other than deleting the repo and setting it up again from scratch. (obviously not the right solution, but I don't know better)

Either fix it by including a config (you don't really have to go down any slope, just include this 1 line for now, and add anything that other users find down the line when or if it happens. easy enough for most users to just PR), or at least document the issue somewhere in the docs. Let users know that global configs might mess with this, specifically this one, and also tell users how to fix it when it happens (including repairing the repo).