Uploaded image for project: 'CFEngine Community'
  1. CFEngine Community
  2. CFE-2014

cf-promises -T should know the currently checked out commit even if you haven't checked out a branch

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: Low
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.7.0
    • Component/s: None
    • Labels:
      None

      Description

      Currently `cf-promises -T` will generate cf_promsies_release_id with the SHA of HEAD for the currently checked out branch, or in the event that the directory is not a git repository it will fall back to generating a sha of the tree.

      This works great if you are always running the latest code for a given branch. However if you are checking out a tag it then it falls back to generating a sha of the tree.

      I believe this was an oversight as it's most common to check out a branch. But it does not make sense to fall back to self generation if a specific commit is checked out.
      It would be extra nice if it recorded the tag name in addition to the sha if in fact the commit checked out is a tag.

      <pre>
      > $ git checkout master [±master ●▴]
      Already on 'master'
      Your branch is ahead of 'origin/master' by 8 commits.
      (use "git push" to publish your local commits)

      nickanderson@nickanderson-ThinkPad-W520 ~/CFEngine/masterfiles [12:38:40]
      > $ git name-rev --name-only --tags HEAD [±master ●▴]
      undefined

      > $ git checkout 3.7.0b1 [±master ●▴]
      Note: checking out '3.7.0b1'.

      You are in 'detached HEAD' state. You can look around, make experimental
      changes and commit them, and you can discard any commits you make in this
      state without impacting any branches by performing another checkout.

      If you want to create a new branch to retain commits you create, you may
      do so (now or later) by using -b with the checkout command again. Example:

      git checkout -b new_branch_name

      HEAD is now at a9d202e... Beta.

      nickanderson@nickanderson-ThinkPad-W520 ~/CFEngine/masterfiles [12:39:37]
      > $ git name-rev --name-only --tags HEAD [±a9d202e ●]
      3.7.0b1^0
      </pre>

        Attachments

          Activity

            People

            Assignee:
            a10042 Nick Anderson
            Reporter:
            a10042 Nick Anderson
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 2 hours
                2h
                Remaining:
                Not Specified
                Logged:
                Time Not Required
                Not Specified