huumn / git-remote-gitern

git-remote-gitern is a git remote helper that end to end encrypts git repos without a custom remote receiver and without additional user key management.
MIT License
11 stars 2 forks source link

"Merging" into a crypted mirror repo, hmm? #1

Open pfalcon opened 1 year ago

pfalcon commented 1 year ago

https://github.com/huumn/git-remote-gitern/blob/3da454bf34921cf874ece1a75a7b8c2c58ea6fa8/git-remote-gitern#L181

What would be an idea behind "merging"? How exactly would you merge crypted content? What if there's a conflict?

That seems contra-logical. Mirror repo should always be a mirror of remote repo. The whole existence of mirror repo is due to lack in-flight transcoding on the level of git-receive-pack/git-upload-pack. You don't "merge" in git-receive-pack/git-upload-pack, ergo shouldn't merge there. It should be pull --rebase or actually likely git fetch (well, you'd know better why the bare repo didn't work for you).

Where "merging" should happen is on the level of local (main) repo. Decrypting should happen into a separate ref, and that ref should be then either merged or rebased to (again, how a normal pull would work).

P.S. Working on getting the thing work with rebased repos.

pfalcon commented 1 year ago

Well, yeah, pull --rebase kina behaves as expected, but leaves weird artifacts in mirror repo's workcopy. pull --force doesn't help (makes a merge). Will try just fetch now.

pfalcon commented 1 year ago

Well, it should be force-fetch, with ref update, and that whines due to non-baredness:


fatal: Refusing to fetch into current branch refs/heads/master of non-bare repository
```.

pull --rebase be it workaround for now.