Code Monkey home page Code Monkey logo

Comments (10)

jmurty avatar jmurty commented on August 28, 2024 1

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.

andreineculau avatar andreineculau commented on August 28, 2024 1

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.

elasticdog avatar elasticdog commented on August 28, 2024

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.

dfee avatar dfee commented on August 28, 2024

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.

andreineculau avatar andreineculau commented on August 28, 2024

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:

LATER LATER EDIT
As per SO, I used git update-index -q --really-refresh instead of git status, etc.

from transcrypt.

andreineculau avatar andreineculau commented on August 28, 2024

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.

jmurty avatar jmurty commented on August 28, 2024

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.

andreineculau avatar andreineculau commented on August 28, 2024

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.

jmurty avatar jmurty commented on August 28, 2024

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.

jmurty avatar jmurty commented on August 28, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.