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

.git/crypt/transcrypt: line 245: GIT_REFLOG_ACTION: unbound variable #150

Closed
ZhymabekRoman opened this issue Dec 1, 2022 · 4 comments
Closed

Comments

@ZhymabekRoman
Copy link

Thank you for making transcrypt! When applying a stash with the git stash pop command, this error appears:

.git/crypt/transcrypt: line 245: GIT_REFLOG_ACTION: unbound variable

transcrypt version: e08c359
git version: 2.30.2

@jmurty
Copy link
Collaborator

jmurty commented Dec 3, 2022

Hi @ZhymabekRoman I haven't been able to reproduce this error with some basic testing of git stash and git stash pop but in commit bcc4669 I have applied a potential fix to the one place Transcrypt refers to GIT_REFLOG_ACTION.

Can you test the latest version on the main branch and confirm whether it fixes the unbound variable error for you?

@ZhymabekRoman
Copy link
Author

@jmurty, Thanks for reply!

I haven't been able to reproduce this error with some basic testing

I think it's because I forgot to mention Auto-merging during the git stash.

Full command output with latest transcrypt version:

roman@debian:~/Obsidian$ git stash pop
*** WARNING : deprecated key derivation used.
Using -iter or -pbkdf2 would be better.
.git/crypt/transcrypt: line 267: THEIRS_LABEL: unbound variable
Auto-merging diary/.obsidian/plugins/recent-files-obsidian/data.json
CONFLICT (content): Merge conflict in diary/.obsidian/plugins/recent-files-obsidian/data.json
The stash entry is kept in case you need it again.

@jmurty
Copy link
Collaborator

jmurty commented Dec 5, 2022

Hi @ZhymabekRoman thanks for that clarification. I think I've fixed it properly now in commit 155808d, can you please re-test to confirm?

To be clear for anyone following along, or reading this later, this bug was triggered when you:

  • Stash changes to a secret file (A)
  • Make further changes to that same secret file (A')
  • Apply or pop the stash after adding/staging the A' changes to git's index

If the further changes are staged, git will try to merge the stash content instead of failing with the usual error: Your local changes to the following files would be overwritten by merge error.

Despite using git for years, I didn't know that staging file changes would trigger auto-merge behaviour when applying a stash with changes to the same file. Hat tip to https://stackoverflow.com/a/16613814 for teaching me this.

@ZhymabekRoman
Copy link
Author

@jmurty, I tested the latest version of transcrypt and everything seems to work perfectly! Thank you!

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