<commit_before>import Bacon from 'baconjs'
import colors from 'colors'

let debug = require('debug')('tutum-tagger')

export default function takeNewBranchPushes(pushPayload) {
  return Bacon.once(pushPayload)
    .filter((pushPayload) => {
      let keep = pushPayload.created

      if (keep) {
        debug(`${'Keep:'.green} git branch ${pushPayload.ref.cyan} was created.`)
      } else {
        debug(`${'Skip:'.red} No new git branch was created.`)
      }

      return keep
    })
    .flatMap((pushPayload) => {
      const GIT_BRANCH_REGEX = /refs\/heads\/(.+)/

      let matches = pushPayload.ref.match(GIT_BRANCH_REGEX)

      if (matches && matches.length === 2) {
        let branch = matches[1]

        debug(`${'Successfully'.green} extracted branch name ${branch.cyan}`)

        return {
          commit: pushPayload.head_commit,
          repository: pushPayload.repository,
          branch: branch
        }
      } else {
        debug(`${'Failed'.red} to get branch name from ${pushPayload.ref.cyan}`)

        return Bacon.never()
      }
    })
}<commit_msg>Remove too detailed logging, clean up "take pushes" stream<commit_after>import Bacon from 'baconjs'

export default function takeNewBranchPushes(pushPayload) {
  return Bacon.once(pushPayload)
    .filter((pushPayload) => pushPayload.created)
    .flatMap((pushPayload) => {
      const GIT_BRANCH_REGEX = /refs\/heads\/(.+)/

      let matches = pushPayload.ref.match(GIT_BRANCH_REGEX)

      if (matches && matches.length === 2) {
        let branch = matches[1]

        return {
          commit: pushPayload.head_commit,
          repository: pushPayload.repository,
          branch: branch
        }
      } else {
        return Bacon.never()
      }
    })
}
{'fraction_non_alphanumeric': 0.12877492877492877, 'fraction_numerical': 0.002279202279202279, 'mean_word_length': 2.533199195171026, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6604619', 'n_tokens_mistral': 543, 'n_tokens_neox': 519, 'n_words': 119}