-
Notifications
You must be signed in to change notification settings - Fork 102
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 rm --cached
vs git reset
#120
Comments
#130) * Disable overly fussy shellcheck rule SC2155 for old code * Update expected test output to match changed command hint Code that's been unchanged for years is suddenly being flagged by rule SC2155; perhaps this rule is stricter in newer versions of `shellcheck` or action https://github.com/luizm/action-sh-checker ? Fixes linting failures due to: SC2155: Declare and assign separately to avoid masking return values.
Thanks for the suggestion, this is done in 331b4af |
* main: Improve command hint to fix secret files not encrypted in index (#120) (#130) Remove Ubuntu 16.04 LTS from test matrix (#123) Configure default Git branch name for macOS tests in GitHub Handle rename of primary branch from "master" to "main" Ensure Git index is up-to-date before dirty repo check #37 (#109) Fix incorrect salt when partially staged files are commited (#119) Use shorthand for grep options for broader compatibility (#121)
# By James Murty (18) and others # Via GitHub (1) and James Murty (1) * main: (26 commits) Centralise load and save of password into functions #141 Fix date of 2.2.0 release Ensure tests use "main" as default branch name #143 Use OpenSSL for B64 encoding not `base64` which differs between Linux and Mac #140 Use core attributesFile from worktree (#137) Document `xxd` requirement, and make optional with OpenSSL < 3 (#138) Prepare for 2.2.0 release Fix when using OpenSSL 3 which no longer embeds salt in output (#135) Consolidate all git operation scripts into a single transcrypt script Fix handling of small files and files with null in first 8 bytes (#116) Improve command hint to fix secret files not encrypted in index (#120) (#130) Remove Ubuntu 16.04 LTS from test matrix (#123) Configure default Git branch name for macOS tests in GitHub Handle rename of primary branch from "master" to "main" Ensure Git index is up-to-date before dirty repo check #37 (#109) Fix incorrect salt when partially staged files are commited (#119) Use shorthand for grep options for broader compatibility (#121) Let user set a custom path to openssl #108 Install entire transcrypt script into repository Change version to indicate development "pre-release" status ... # Conflicts: # README.md # tests/_test_helper.bash # tests/test_cleanup.bats # tests/test_crypt.bats # tests/test_init.bats # tests/test_not_inited.bats # transcrypt
That does not work for me in transcrypt 2.2.3. I get the same message as outlined above, but when I follow the directions it has no effect. Transcrypt still complains that the file was staged using an unsupported tool. |
Hi @fortysix2ahead can you describe in detail when and how you added the problem file to the Git index, and when you added a rule for that file to .gitattributes? You can check whether the file staged in the index is really encrypted or not by running commands like:
If transcrypt's pre-commit hook is getting it wrong and the staged file really is properly encrypted, you can work around the problem by disabling the hook so you can commit the file, then (ideally) re-enabling it for safety. E.g: mv .git/hooks/pre-commit .git/hooks/pre-commit.bak
# Commit your secret files
mv .git/hooks/pre-commit.bak .git/hooks/pre-commit |
@jmurty as far as I can remember I used lazygit (which is obviously a non-supported tool) first to stage the file. Afterwards I edited .gitattributes. Interestingly, I did a hard reset for testing, discarding all changes and then staged the file again using git add and still got the same message from transcrypt.
I have the feeling I screwed up my test repo. I'll try more experimenting, maybe I can find out what went wrong. |
Thanks for following up. It's not so much that problematic tools are not supported by transcrypt, it's more that they don't do the work expected based on settings in the .gitattributes file. I'm surprised the The Double-check that your repo has transcrypt configured by displaying the config with |
If you're experimenting with transcrypt, these commands can be helpful: They will show you the raw contents of the file as stored in Git. What you want to see for your encrypted files is a bunch of Base64 text starting with |
Did a retest from scratch and now it seems to work fine. I got a bad type in .gitattributes and got the message as outlined above, which in my case put me on the wrong trail ... |
When I add existing files to Transcrypt via .gitattributes:
config/** filter=crypt diff=crypt merge=crypt
Then
git commit
on other files results in this message:Except that
git reset
has no effect. In order to get past this I have to do this:Would it make sense to change the error message to use
git rm --cached
instead ofgit reset
?The text was updated successfully, but these errors were encountered: