Issue #8161 duplicate

Email Hook Branch Value Bug

adam hills
created an issue

I've noticed that emails sent out as a result of > 1 commits (in a single push), branch values EXCEPT the last commit are set to none.

This is easily reproduced by doing the following:

  1. Modify file1
  2. git add file1
  3. git commit -m "First commit"
  4. Modify file2
  5. git add file2
  6. git commit -m "Second commit"
  7. git push

The triggered email body content will show 2 new commits, the first of which will have a branch value as none. IF the above files were on master, only the last commit would have this value set.

Comments (6)

  1. adam hills reporter

    Hi Michael,

    Using a hook email body template:

    $Number new commits in $RepositoryName:
    
    https://bitbucket.org/username/reponame/commits/changeset/
    Changeset:   short_SHA1
    Branch:      master/branch_name/tag_value
    User:        user_who_pushed
    Date:        year-month-day 24hour:minute:second
    Summary:     commit_msg
    
    Affected:  $Number_Of_Files file 
    
    $Number = total number of commits in push
    $RepositoryName = git cloned repository
    $Number_Of_Files = total number of files affected by this commit
    

    The 'Branch' appears to be which refs/heads/value we are pushing.

    NOTE: The above template from the https://*/commits/changeset/ URL to the 'Affected' will be added to the email body per commit.

    SO for two commits (both on master) in one push, the first 'Branch' will always be none, the last will be master.

    Is that clear?

  2. Log in to comment