Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to check in log about 'git rev-parse HEAD'
QtWS25 Last Chance

How to check in log about 'git rev-parse HEAD'

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 348 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kelly
    wrote on last edited by
    #1

    I added below in .pro, and I want to check GIT_TAG in log via LogFilter.
    But it is not working, what should I do?

    GIT_TAG = $$system(git rev-parse HEAD)
    GIT_SUBMISSION = $$system(git describe --abbrev=0 --tags)

    DEFINES += GIT_TAG=\"$$GIT_TAG\"
    DEFINES += GIT_SUBMISSION=\"$$GIT_SUBMISSION\"

    jsulmJ aha_1980A 2 Replies Last reply
    0
    • K kelly

      I added below in .pro, and I want to check GIT_TAG in log via LogFilter.
      But it is not working, what should I do?

      GIT_TAG = $$system(git rev-parse HEAD)
      GIT_SUBMISSION = $$system(git describe --abbrev=0 --tags)

      DEFINES += GIT_TAG=\"$$GIT_TAG\"
      DEFINES += GIT_SUBMISSION=\"$$GIT_SUBMISSION\"

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @kelly said in How to check in log about 'git rev-parse HEAD':

      But it is not working

      What happens?
      Are you sure "git rev-parse HEAD" is called inside your source tree?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      K 1 Reply Last reply
      1
      • jsulmJ jsulm

        @kelly said in How to check in log about 'git rev-parse HEAD':

        But it is not working

        What happens?
        Are you sure "git rev-parse HEAD" is called inside your source tree?

        K Offline
        K Offline
        kelly
        wrote on last edited by
        #3

        @jsulm
        Someone just told me that will be worked.
        I just want to check recent revision in console.
        Is there any way?

        jsulmJ 1 Reply Last reply
        0
        • K kelly

          @jsulm
          Someone just told me that will be worked.
          I just want to check recent revision in console.
          Is there any way?

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @kelly Again: what happens if you execute qmake with that lines?

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • K kelly

            I added below in .pro, and I want to check GIT_TAG in log via LogFilter.
            But it is not working, what should I do?

            GIT_TAG = $$system(git rev-parse HEAD)
            GIT_SUBMISSION = $$system(git describe --abbrev=0 --tags)

            DEFINES += GIT_TAG=\"$$GIT_TAG\"
            DEFINES += GIT_SUBMISSION=\"$$GIT_SUBMISSION\"

            aha_1980A Offline
            aha_1980A Offline
            aha_1980
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Hi @kelly,

            I'm successfully using the following snippet in my projects:

            SHA1 = $$system(git rev-parse --short=8 HEAD)
            DEFINES += "GITSHA1=\\\"$$SHA1\\\""
            

            The main difference to your snippet is the quoting of the defines line. You might want to check that.

            Regards

            Qt has to stay free or it will die.

            1 Reply Last reply
            2

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved