-
Notifications
You must be signed in to change notification settings - Fork 491
Issue performing interactive rebases #53
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
Comments
Just to be clear, those are the exact sequence of commands you're running? |
Hi Gah - I did the worst possible thing for submitting a support ticket - leaving out steps. Sorry about that. I was hoping you'd immediately say 'yep, it's a known issue' or 'no, there's no issue'
Oskar |
Thanks for clarifying that. No, this isn't a known issue, and I'm able to do interactive rebases with Git 2.4.0 without issue. Was the |
Hi I'm almost certain this has to do with an encrypted zero-byte file in the repository. I've re-created the problem as per the below: General initiation:
After the above, here's the status:
Now try create a branch and make some changes:
Status before the rebase - everything looks ok:
Now, try rebase and we get the error:
It's also worth noting that if I view the directory in textmate, the zero-byte-file.key file appears to have uncommitted changes - despite what 'git status' says. |
Just to add an explanation of why we have zero-byte encrypted files (which is indeed pretty odd). We've encrypted everything in a python source code directory. That includes the |
Reproduced with an empty file - nice work tracking this down! I'm now debugging... |
@AGWA Hi, I'm running into this issue as well. Would having more information help? |
Hi, I've run into this issue, too - while setting up git-crypt for an etckeeper repository. It seems that all these zero-byte files misbehave not only on rebase attempt. |
I've run in to this issue as well, and the issue is pretty hard to track down if the zero-length file gets introduced in a repo that's had quite a few changes / encrypted files. I've been thinking about how to surface this issue to consumers until the bug is fixed. It'd be nice if @AGWA have you had the spare time or any luck tracking down the root cause for this? |
In the process of looking for a solution, I came across 'git diff-files' which exposed the zero byte files encountered in my repo. (From a stackoverflow page.) To paraphrase the answer, "git rebase is a shell script. grep it for 'have unstaged changes' and you will find the function require_clean_work_tree, which in turn runs 'git diff-files'." It hasn't helped resolve any issue, but if you are confounded by the message, hopefully this will expose the affected files. |
I think these may help track the problem down:
Could the issue be solved by not encrypting zero byte files? Encryption is deterministic, so it shouldn't be a security issue. |
This is a stopper in using I was just tried |
git has several problems with using smudge/clean filters on empty files (see issue #53). The easiest fix is to just not encrypt empty files. Since it was already obvious from the encrypted file length that a file was empty, skipping empty files does not decrease security. Since skipping empty files is a breaking change to the git-crypt file format, we only do this on new repositories. Specifically, we add a new critical header field to the key file called skip_empty which is set in new keys. We skip empty files if and only if this field is present. Closes: #53 Closes: #162
Hi @oskarpearson , how did you manage to solve the problem? I guess you did because you closed the issue. I am in a similar situation: I added empty files initially to the repo, then added content to these files and now I can not rebase. Git detects something and tells me to stash, but stashing does not change anything because there is nothing to stash. I dont even know how to proceed in this situation. Could you describe the steps you took to get out of this situation? thanks in advance |
Hi @nkrot I've not used git-crypt for a few years, and it seemed like the above commit should resolve the issues, so I thought it best to close it. You're welcome to re-open it. |
In case someone wonders what to do if you forgot to encrypt a file, here's a gist. |
Hi
I was wondering if there is a known problem with interactive rebasing? This happens on a freshly-cloned repo containing git-crypt objects:
Unfortunately I can't share the actual repo that has the issue.
Environment:
Thanks for your time!
The text was updated successfully, but these errors were encountered: