-
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
Detection of clean repo is not reliable. #37
Comments
I wonder if there is some stale stat info from whatever codefresh is doing. Instead of running
|
I've experienced the same thing using CircleCI. I solved it by doing a |
Hate to do a +1, but I'm now experiencing this when running WSL on Windows on Github Actions. LATER EDIT Explanations:
LATER LATER EDIT |
Hmm, is there any reason we shouldn't apply the naïve but simple "fix" and always run It would be weird voodoo, but should at least solve the problem. |
It's not really voodoo :) after you read the tiny details, that is.... sigh it's just that diff-index gives you a probabilistic view of the world, not a binary one that's all. So if we want to stick to diff-index, then we need update-index. Otherwise we can use a higher-level git command like |
for example, have a look at how the git bash prompt detects dirty state |
Should fix/avoid failures seen in CI systems where the repo seems dirty when it really isn't.
Hi @andreineculau it's been a while sorry, but I have created a pull request with a potential fix to more reliably detect dirty repositories, without false positives. It would be great if you could look over it or test it: #109 |
Well, I have already implemented this in ysoftwareab/yplatform@4834b27 (basically just for my usecase of WSL in CI) and it does work. I'd be surprised if your fix gives degraded outcome. I'm currently not able to test this, but it's a +1 from me. |
Hi @mrmachine @dfee and anyone else watching this issue, could someone test and confirm the potential fix for detection of dirty repos in pull request #109? |
With the merge of #109 this issue should now be fixed. Please re-open if dirty repo detection is still failing for you when using the latest transcrypt from the |
* 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
I'm using codefresh to build Docker images (including the
.git
directory), with an entrypoint script that configures the git repo for transcrypt with a password from the environment, to decrypt secret files at runtime.transcrypt thinks the git repo is dirty:
When I run the
git diff-index
command that transcrypt uses internally (minus the--quiet
arg), it seems to return some odd results:# git diff-index HEAD -- | tail :100644 100644 3d6e0e93c2bfef67162836b2f0b5ad24c526929e 0000000000000000000000000000000000000000 M staticroot/apple-touch-icon-precomposed.png :100644 100644 9089ef7ffea1efe2de79b49b5e6a5856360de4d6 0000000000000000000000000000000000000000 M staticroot/apple-touch-icon.png :100644 100644 7b74f8caf013ba164ca9049f7bd4eea0555ff720 0000000000000000000000000000000000000000 M staticroot/favicon.ico :100644 100644 5d00a90141a920a278e2a8239e560b7ea395a1db 0000000000000000000000000000000000000000 M staticroot/humans.txt :100644 100644 214e4119653f9c6a4c48cd0ebb06a6754f00f62b 0000000000000000000000000000000000000000 M staticroot/robots.txt
But the repo is clean, cloned and built by codefresh:
# git status HEAD detached at 153c57c nothing to commit, working directory clean
Strangely, after running
git status
, transcrypt suddenly agrees that the repo is clean and agrees to configure the repo:Is there something wrong with the way codefresh is cloning the repo before it builds the Docker image?
Is there a more reliable way transcrypt can detect a dirty repo (as reported by
git status
)?The text was updated successfully, but these errors were encountered: