Code Monkey home page Code Monkey logo

Comments (5)

Thomas-Gelf avatar Thomas-Gelf commented on September 2, 2024 1

NB: in case it doesn't, more foo can be added 😆

from icinga2-diagnostics.

Thomas-Gelf avatar Thomas-Gelf commented on September 2, 2024

@widhalmt: I disagree, having a GIT working directory is the best what could happen to you when you want to figure out the installed version. Please use at least something like git describe, or some shell voodoo like this:

grep -q ^ref: .git/HEAD && cat .git/$(grep ^ref: .git/HEAD | cut -d ' ' -f 2)

Whether a working directory is dirty (check porcelain, git status) might be very interesting to know. There is absolutely no better place for all this diagnose work than ... well, I have to repeat myself, a cloned GIT repository :-)

from icinga2-diagnostics.

widhalmt avatar widhalmt commented on September 2, 2024

Ok, then. Thank you for your insights. I was unsure about that but I had to decide for a way to go. To say it with the crusader from Indiana Jones: My choice was bad.

Thanks a lot. I'll add this to the script.

from icinga2-diagnostics.

widhalmt avatar widhalmt commented on September 2, 2024

Just to add a bit of information: The Script already fetched the git commit that was used when it found a .git directory. Of course, your shell-fu is mightier than mine so it was just a print of the latest git log entry.
Nonetheless I wanted to have this appear in the anomalies section because I saw many users use a git clone without caring if they got a release or just random commit. So I wanted to do both:

  • Show if we are running a Director release or just some random commit
  • Make the supporter aware that there is a git clone in use which might be changed every time.

My assumption was, if someone used a release archive for installation they are likely to do so in the future. If someone uses a git clone with a release it could mean that they checked out a release on purpose or by accident. If the latter ist the case they would do a git pull sometimes and that is what I wanted to make the reader of the output aware of.

Maybe it would be a good idea to check if the used checkout is the freshest commit available in the clone?

from icinga2-diagnostics.

Thomas-Gelf avatar Thomas-Gelf commented on September 2, 2024

Above short snippet should be most of this I guess. Check out a specific tag and try, checkout master - and try again.

from icinga2-diagnostics.

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.