Comments (10)
Hmm, is there any reason we shouldn't apply the naïve but simple "fix" and always run git update-index -q --really-refresh
or git status
before checking for a clean repository?
It would be weird voodoo, but should at least solve the problem.
from transcrypt.
for example, have a look at how the git bash prompt detects dirty state
https://github.com/git/git/blob/e31aba42fb12bdeb0f850829e008e1e3f43af500/contrib/completion/git-prompt.sh#L527-L528
from transcrypt.
I wonder if there is some stale stat info from whatever codefresh is doing. Instead of running git status
, if you touch all of the encrypted files, does the clean check work as expected?
cd $(git rev-parse --show-toplevel)
touch $(git ls-crypt)
from transcrypt.
I've experienced the same thing using CircleCI. I solved it by doing a git reset --hard HEAD
even though when I'd ssh'ed in, git status
returned nothing to commit, working directory clean
from transcrypt.
Hate to do a +1, but I'm now experiencing this when running WSL on Windows on Github Actions.
LATER EDIT
It is just mesmerizing how running git status
before decrypting can workaround the situation 🤔
Explanations:
- https://stackoverflow.com/questions/34807971/why-does-git-diff-index-head-result-change-for-touched-files-after-git-diff-or-g
- https://public-inbox.org/git/[email protected]/T/#u
LATER LATER EDIT
As per SO, I used git update-index -q --really-refresh
instead of git status
, etc.
from transcrypt.
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 git status
that gives you a binary answer.
from transcrypt.
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
from transcrypt.
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.
from transcrypt.
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?
from transcrypt.
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 master
branch.
from transcrypt.
Related Issues (20)
- is it possible to use a password to allow only committer who known it to decipher files HOT 2
- feat: Transparent file name encryption
- Transcrypt can fail to run in Jenkins when Git hooks are disabled: `mkdir: can't create directory '/dev/null': File exists` HOT 8
- Error `transcrypt smudge context=default' failed 1` since version 2.2.1 HOT 13
- rekeying broken in 2.3.0-pre HOT 4
- decryption not happening on OS in FIPS compliant mode HOT 7
- File name encryption HOT 1
- Is there any way to have diff's work inside git clients, such as Sublime Merge? HOT 3
- encryption changed, but no change! HOT 5
- Creating a second context on pre-release branch creates duplicate pre-commit file HOT 2
- Cannot detect transcrypt repo HOT 4
- openssl: WARNING : deprecated key derivation used. Using -iter or -pbkdf2 would be better. HOT 2
- transcrypt: unknown option -- context HOT 2
- mkdir: /dev/null: File exists HOT 2
- Feature Request: encrypt a file partially only HOT 2
- Handle quotes and colon in filenames HOT 3
- context cannot be flushed and reencrypted anymore HOT 4
- Completion in zsh doesn't work
- Password echoing to terminal? How can I set password securely? HOT 2
- Unexpected commit with git log --all
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from transcrypt.