Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recommended ways for resolving merge conflicts in encrypted files. #327

Closed
sanjo-joy opened this issue Apr 28, 2021 · 2 comments
Closed

Comments

@sanjo-joy
Copy link

Hi,
I was trying to integrate Blackbox with our project and have came across a situation where I got merge conflicts while applying the stashed changes. Please find the detailed steps below:

  1. Make some changes, encrypt the file, and commit the changes (probably the gpg file).
  2. Checkout to a new branch, decrypt the file make changes to the same file at same line.
  3. Encrypt the file again commit the changes(let's say commit with id 'xyz').
  4. Checkout to the previous branch.
  5. Decrypt the file again (This would decrypt the file with the changes in the current branch, just to make sure no changes from the new branch is available at this moment).
  6. Make changes to the same file same place (Just to create a possible scenario for conflict).
  7. Encrypt the file again and then stash this change.
  8. Cherry-pick the commit we made earlier from the new branch (the commit with id 'xyz').
  9. Then apply the stashed changes. This would probably create a merge conflict.

May also try some other situations that would create a merge conflict.

In these situations of a merge conflicts I am unable to resolve it as the conflict is showing in the encrypted file.

Currently a workaround we have in mind is to decrypt both the versions of the file. Then compare and accept the changes manually.

I believe this is not directly related to Blackbox and more of a binary file related thing. But it would be really helpful to know how others are getting around this issue. I have found similar issue #73 , but couldn't find much information from it, so created this again.

Thanks,
Sanjo

@tlimoncelli
Copy link
Contributor

Hi there!

Sorry to hear you are having this problem.

I agree that this is a problem with Git, not blackbox. Blackbox is a layer on top of Git, we don't try to fix Git's problems.

The manual merge is easier if you configure Git to understand how to diff the files. Here's some advice about that: https://gist.github.com/marceloalmeida/e6593b93b388cdf1dbc282dffd424d1b

Hope that helps!

@sanjo-joy
Copy link
Author

Hi,
Thanks for the quick response.

The manual merge is easier if you configure Git to understand how to diff the files. Here's some advice about that: https://gist.github.com/marceloalmeida/e6593b93b388cdf1dbc282dffd424d1b

This sounds good to me. I think I can proceed with this approach.
Thanks for the help,
Sanjo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants