Skip to content
This repository has been archived by the owner on May 7, 2024. It is now read-only.

Fix merge of encrypted files with conflicts #1

Merged
merged 1 commit into from
Nov 4, 2019

Conversation

jmurty
Copy link

@jmurty jmurty commented Nov 1, 2019

Fix transcrypt's handling of merges where encrypted
files have conflicting changes, a situation which
would lead to Git producing "merged" files with
conflict markers around partially- or fully-
encrypted content that cannot be sensibly merged
by a person.

The root problem is that git does not run the
smudge/textconv filter on all BASE, LOCAL, REMOTE
conflicting version files before attempting a
three-way merge.

This change adds:

  • a merge driver script to pre-decrypt
    conflicting BASE, LOCAL, and REMOTE file
    versions then run git's internal merge-file
    command to merge the decrypted versions
  • git repo settings to configure the merge driver
  • recommendation to add the extra "merge=crypt"
    setting to .gitattribute definitions.

Fix transcrypt's handling of merges where encrypted
files have conflicting changes, a situation which
would lead to Git producing "merged" files with
conflict markers around partially- or fully-
encrypted content that cannot be sensibly merged
by a person.

The root problem is that git does not run the
smudge/textconv filter on all BASE, LOCAL, REMOTE
conflicting version files before attempting a
three-way merge.

This change adds:
- a merge driver script to pre-decrypt
  conflicting BASE, LOCAL, and REMOTE file
  versions then run git's internal `merge-file`
  command to merge the decrypted versions
- git repo settings to configure the merge driver
- recommendation to add the extra "merge=crypt"
  setting to .gitattribute definitions.
@jmurty jmurty merged commit a732f15 into master Nov 4, 2019
jmurty added a commit to ixc/ixc-django-docker that referenced this pull request Nov 12, 2019
Update the `transcrypt` encryption utility to be
based on upstream's version 1.1.0 but also with
new features from our IC fork:

- on init, add a merge driver to properly handle
  merge of secrets files with conflicting changes:
  ixc/transcrypt#1
  The .gitattributes file is also adjusted to
  apply the merge driver.
- on init, add a Git pre-commit hook script to
  abort commit if raw content of a secrets file
  is not properly encrypted:
  ixc/transcrypt#2
- cherry-picked upstream fix to silence spurious
  warnings:
  github.com/elasticdog/transcrypt/commit/9a8a1f

Script sourced from
ixc/transcrypt@e9e1d96c
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants