Code Monkey home page Code Monkey logo

Comments (1)

terminalforlife avatar terminalforlife commented on June 11, 2024

Thanks! I forgot all about that. I intended to use ! years ago, but never got around to it.

I'm working on this now. There's line 43:

if git rev-parse --is-inside-work-tree &> /dev/null; then

If you're not inside a Git repository, it'll simply treat it like — well, like you're not in a repository. Lol You're right, there's basically no error-checking, which is unlike me. I guess I was just writing it as I went along. All these years, and I've still yet to get such a fatal error, other than the usual "not a git repository" errors.

Git commands are kind of weird for scripting, because they don't just use helpful exit codes. Like, that above command has either 0 or 128, which is not all that helpful. They should have one for when something broke, and 0 for is a Git repository and 1 for is not a git repository.

I want to address this, but I can't yet think of a clean way to do this, without just making a mess. I need a way to test a broken repository, but how on Earth do you even break a repository? I've tried deleting random files in '.git', but Git assumes it's then not a Git repository. Lol

The best I can do, is add a check for the exact message you got from git status, and any other git status-specific errors or messages I need to test for. I've been able to recreate the problem by messing with ownership of the repository, so hopefully I'll have that implemented soon. I see there's a lot of hubbub online from this recent git(1) change. Lol How did you fix it? Did you just change the ownership? I hear a lot of people are messing with some sort of safe.directory option.

from bashconfig.

Related Issues (2)

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.