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

[bug] Passwords deleted when merging #638

Open
haji-ali opened this issue Mar 7, 2024 · 5 comments
Open

[bug] Passwords deleted when merging #638

haji-ali opened this issue Mar 7, 2024 · 5 comments

Comments

@haji-ali
Copy link

haji-ali commented Mar 7, 2024

I am using Pass with a common git repo. An issue I noticed is that when the Pass merges local changes with changes from remote, it deletes any new files in remote and commits the result!

I seem to have a commit "Merge branch 'master'" by "Mobile User" which correctly merges the commits and then the next time I add a password, a commit by "Pass for iOS" deletes the merged files and adds the new one only.

@luk0y
Copy link

luk0y commented May 26, 2024

You can still get the deleted file from the commit history isn't it?

@haji-ali
Copy link
Author

Yes, hardly a solution though. I don’t always notice the file deletion until I need the password

@phaabe
Copy link

phaabe commented Feb 14, 2025

I have the same experience:

  1. I add new password from my computer, I push those
  2. I add a new password on iOS (I think here the password from the computer is deleted).

The commit shows that the password was added.
The commit also shows the deleted files.

Why would the app iOS delete them? also you don't realize until you need them.

@phaabe
Copy link

phaabe commented Feb 14, 2025

I tried to reproduce it precisely and here is how to it occurs. If I don't do anything wrong here, I think it's a relevant bug that should be fixed.

Here what happens based on git commits:

  1. A new entry is added from a computer
    <commit-hash-1> Add generated password for test-2.

  2. A new password is added using Pass for iOS
    <commit-hash-2> Add password for newfrommobile to store using Pass for iOS.

  3. Pulling down to sync from Pass for iOS introduces this merge
    <commit-hash-3> Merge branch 'master'

  4. The pass which was newly introduced on mobile is edited.
    <commit-hash-4> (HEAD -> master, origin/master, origin/HEAD) Edit password for newfrommobile using Pass for iOS.

git show <commit-hash-4> shows that the entry test-2 is deleted

Author: Pass for iOS <user@passforios>
Date:   Fri Feb 14 14:29:22 2025 +0100

    Edit password for newfrommobile using Pass for iOS.

diff --git a/newfrommobile.gpg b/newfrommobile.gpg
index <indexes-1>
Binary files a/newfrommobile.gpg and b/newfrommobile.gpg differ
diff --git a/test-2.gpg b/test-2.gpg
deleted file mode <indexes-2>
index <indexes-3>
Binary files a/test-2.gpg and /dev/null differ

@luk0y can you reproduce this on your side and give help? maybe we are doing something wrong? Maybe it's a bug though.

@phaabe
Copy link

phaabe commented Feb 18, 2025

I found the issue. Pass for iOS is not able to handle a merge from two parents and just ignores one parent (the one pushed from your computer to git).

The best practice I think is:
Keep the commits in a clear line by using pass git pull --rebase on the computer instead of pass git pull only.

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

3 participants