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

auto transform from dot (.) to hash (#) in execresult

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: 3.7.0, 3.7.8
    • Fix Version/s: 3.10.0
    • Component/s: None
    • Labels:
      None
    • Platform:
      Debian

      Description

      Hi,
      I have this promise for getting logs from specified revision to now (the bold part is important):
      "git_log_$(update_def.branch_names)"
      string => execresult("/usr/bin/git --git-dir=$(update_def.branch_avail[$(update_def.branch_names)])/.git log $(git_last_$(update_def.branch_names)).. --color=never --stat --pretty='format:%h %s%n %an, %ai%n%w(80,8,8)%b'", "useshell"),
      comment => "Get last logs from updated branch.",
      ifvarclass => canonify("branch_$(update_def.branch_names)_has_changed"),
      classes => u_if_repaired("git_log_$(update_def.branch_names)_ready");

      Problem is on first dot after bold variable, these dot (.) will be rewrite to hash (#). I should get logs by this command (simplified):
      git log <revision>..
      but cf-agent call
      git log <revision>#.

      Here is verbose output:
      2015-11-05T10:09:02+0100 verbose: /default/update/vars: execresult ran '/usr/bin/git --git-dir=/var/cfengine/masterfiles_branches/devel/.git log 12291ec5d5f74e300281aee82882405ea61e3da8#. --color=never --stat --pretty='format:%h %s%n %an, %ai%n%w(80,8,8)%b'' successfully
      2015-11-05T10:09:02+0100 verbose: /default/update/vars: Caching result for function 'execresult(/usr/bin/git --git-dir=$(update_def#branch_avail[$(update_def#branch_names)])/.git log $(git_last_$(update_def#branch_names))#. --color=never --stat --pretty='format:%h %s%n %an, %ai%n%w(80,8,8)%b',useshell)'

      And error message from called git:
      fatal: ambiguous argument '12291ec5d5f74e300281aee82882405ea61e3da8#.': unknown revision or path not in the working tree.
      Use '--' to separate paths from revisions, like this:
      'git <command> [<revision>...][<file>...]'

      Thanks
      Michal

        Attachments

          Activity

            People

            • Assignee:
              a10042 Nick Anderson
              Reporter:
              svamberg Michal Švamberg
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Summary Panel