Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-13872

git JIRA hook is not idempotent

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Minor
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.4.2
    • Fix Version/s: None
    • Labels:
      None
    • Documentation Required?:
      None
    • Funding Source:
      Core Team Funds

      Description

      If a commit is amended after the JIRA block has been added to the tail of the commit message, the following parse error blows up the commit:

      adamw:/work/civicrm/CRM/Core/CodeGen$ git commit --amend
      Commited successfully.
      PHP Fatal error: Uncaught exception 'Exception' with message 'Invalid JIRA key: CRM-13871:' in /work/civicrm/packages/git-footnote/src/CRM/GitFootnote/JiraFilter.php:96
      Stack trace:
      #0 /work/civicrm/packages/git-footnote/src/CRM/GitFootnote/JiraFilter.php(75): CRM\GitFootnote\JiraFilter->getIssue('CRM-13871:')
      #1 /work/civicrm/packages/git-footnote/src/CRM/GitFootnote/AbstractWordFilter.php(13): CRM\GitFootnote\JiraFilter->filterWord(Object(CRM\GitFootnote\CommitMessage), 'CRM-13871:')
      #2 /work/civicrm/packages/git-footnote/src/CRM/GitFootnote/JiraFilter.php(39): CRM\GitFootnote\AbstractWordFilter->filter(Object(CRM\GitFootnote\CommitMessage))
      #3 /work/civicrm/packages/git-footnote/bin/git-footnote(18): CRM\GitFootnote\JiraFilter->filter(Object(CRM\GitFootnote\CommitMessage))
      #4

      {main}

      thrown in /work/civicrm/packages/git-footnote/src/CRM/GitFootnote/JiraFilter.php on line 96

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                adamw Adam Wight
                Reporter:
                adamw Adam Wight
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: