<commit_before>vvavarvar var fvar fsvar fs var fs =var fs = var fs = rvar fs = revar fs = reqvar fs = requvar fs = requivar fs = requirvar fs = requirevar fs = require(var fs = require('var fs = require('fvar fs = require('fsvar fs = require('fs'var fs = require('fs')var fs = require('fs');var fs = require('fs');
var fs = require('fs');
vvar fs = require('fs');
vavar fs = require('fs');
varvar fs = require('fs');
var var fs = require('fs');
var cvar fs = require('fs');
var chvar fs = require('fs');
var chivar fs = require('fs');
var chilvar fs = require('fs');
var childvar fs = require('fs');
var child_var fs = require('fs');
var child_pvar fs = require('fs');
var child_prvar fs = require('fs');
var child_provar fs = require('fs');
var child_procvar fs = require('fs');
var child_procevar fs = require('fs');
var child_procesvar fs = require('fs');
var child_processvar fs = require('fs');
var child_process var fs = require('fs');
var child_process =var fs = require('fs');
var child_process = var fs = require('fs');
var child_process = rvar fs = require('fs');
var child_process = revar fs = require('fs');
var child_process = reqvar fs = require('fs');
var child_process = requvar fs = require('fs');
var child_process = requivar fs = require('fs');
var child_process = requirvar fs = require('fs');
var child_process = requirevar fs = require('fs');
var child_process = require(var fs = require('fs');
var child_process = require('var fs = require('fs');
var child_process = require('cvar fs = require('fs');
var child_process = require('chvar fs = require('fs');
var child_process = require('chivar fs = require('fs');
var child_process = require('chilvar fs = require('fs');
var child_process = require('childvar fs = require('fs');
var child_process = require('child_var fs = require('fs');
var child_process = require('child_pvar fs = require('fs');
var child_process = require('child_prvar fs = require('fs');
var child_process = require('child_provar fs = require('fs');
var child_process = require('child_procvar fs = require('fs');
var child_process = require('child_procevar fs = require('fs');
var child_process = require('child_procesvar fs = require('fs');
var child_process = require('child_processvar fs = require('fs');
var child_process = require('child_process'var fs = require('fs');
var child_process = require('child_process')var fs = require('fs');
var child_process = require('child_process')
var fs = require('fs');
var child_process = require('child_process')

var fs = require('fs');
var child_process = require('child_process')

ivar fs = require('fs');
var child_process = require('child_process')

ifvar fs = require('fs');
var child_process = require('child_process')

if var fs = require('fs');
var child_process = require('child_process')

if (var fs = require('fs');
var child_process = require('child_process')

if ( var fs = require('fs');
var child_process = require('child_process')

if ( pvar fs = require('fs');
var child_process = require('child_process')

if ( prvar fs = require('fs');
var child_process = require('child_process')

if ( provar fs = require('fs');
var child_process = require('child_process')

if ( procvar fs = require('fs');
var child_process = require('child_process')

if ( procevar fs = require('fs');
var child_process = require('child_process')

if ( procesvar fs = require('fs');
var child_process = require('child_process')

if ( processvar fs = require('fs');
var child_process = require('child_process')

if ( process.var fs = require('fs');
var child_process = require('child_process')

if ( process.avar fs = require('fs');
var child_process = require('child_process')

if ( process.arvar fs = require('fs');
var child_process = require('child_process')

if ( process.argvar fs = require('fs');
var child_process = require('child_process')

if ( process.argvvar fs = require('fs');
var child_process = require('child_process')

if ( process.argv[var fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ var fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2var fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 var fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ]var fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] var fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] &var fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] &&var fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && var fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && pvar fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && prvar fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && provar fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && procvar fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && procevar fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && procesvar fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && processvar fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && process.var fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && process.avar fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && process.arvar fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && process.argvar fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && process.argvvar fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && process.argv[var fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && process.argv[ var fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && process.argv[ 3var fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && process.argv[ 3 var fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && process.argv[ 3 ]var fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && process.argv[ 3 ] var fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && process.argv[ 3 ] )var fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && process.argv[ 3 ] ) var fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && process.argv[ 3 ] ) {var fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && process.argv[ 3 ] ) {
var fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && process.argv[ 3 ] ) {
 var fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && process.argv[ 3 ] ) {
  var fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && process.argv[ 3 ] ) {
  vvar fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && process.argv[ 3 ] ) {
  vavar fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && process.argv[ 3 ] ) {
  varvar fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && process.argv[ 3 ] ) {
  var var fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && process.argv[ 3 ] ) {
  var ivar fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && process.argv[ 3 ] ) {
  var in<commit_msg>Update character<commit_after>vvavarvar var fvar fsvar fs var fs =var fs = var fs = rvar fs = revar fs = reqvar fs = requvar fs = requivar fs = requirvar fs = requirevar fs = require(var fs = require('var fs = require('fvar fs = require('fsvar fs = require('fs'var fs = require('fs')var fs = require('fs');var fs = require('fs');
var fs = require('fs');
vvar fs = require('fs');
vavar fs = require('fs');
varvar fs = require('fs');
var var fs = require('fs');
var cvar fs = require('fs');
var chvar fs = require('fs');
var chivar fs = require('fs');
var chilvar fs = require('fs');
var childvar fs = require('fs');
var child_var fs = require('fs');
var child_pvar fs = require('fs');
var child_prvar fs = require('fs');
var child_provar fs = require('fs');
var child_procvar fs = require('fs');
var child_procevar fs = require('fs');
var child_procesvar fs = require('fs');
var child_processvar fs = require('fs');
var child_process var fs = require('fs');
var child_process =var fs = require('fs');
var child_process = var fs = require('fs');
var child_process = rvar fs = require('fs');
var child_process = revar fs = require('fs');
var child_process = reqvar fs = require('fs');
var child_process = requvar fs = require('fs');
var child_process = requivar fs = require('fs');
var child_process = requirvar fs = require('fs');
var child_process = requirevar fs = require('fs');
var child_process = require(var fs = require('fs');
var child_process = require('var fs = require('fs');
var child_process = require('cvar fs = require('fs');
var child_process = require('chvar fs = require('fs');
var child_process = require('chivar fs = require('fs');
var child_process = require('chilvar fs = require('fs');
var child_process = require('childvar fs = require('fs');
var child_process = require('child_var fs = require('fs');
var child_process = require('child_pvar fs = require('fs');
var child_process = require('child_prvar fs = require('fs');
var child_process = require('child_provar fs = require('fs');
var child_process = require('child_procvar fs = require('fs');
var child_process = require('child_procevar fs = require('fs');
var child_process = require('child_procesvar fs = require('fs');
var child_process = require('child_processvar fs = require('fs');
var child_process = require('child_process'var fs = require('fs');
var child_process = require('child_process')var fs = require('fs');
var child_process = require('child_process')
var fs = require('fs');
var child_process = require('child_process')

var fs = require('fs');
var child_process = require('child_process')

ivar fs = require('fs');
var child_process = require('child_process')

ifvar fs = require('fs');
var child_process = require('child_process')

if var fs = require('fs');
var child_process = require('child_process')

if (var fs = require('fs');
var child_process = require('child_process')

if ( var fs = require('fs');
var child_process = require('child_process')

if ( pvar fs = require('fs');
var child_process = require('child_process')

if ( prvar fs = require('fs');
var child_process = require('child_process')

if ( provar fs = require('fs');
var child_process = require('child_process')

if ( procvar fs = require('fs');
var child_process = require('child_process')

if ( procevar fs = require('fs');
var child_process = require('child_process')

if ( procesvar fs = require('fs');
var child_process = require('child_process')

if ( processvar fs = require('fs');
var child_process = require('child_process')

if ( process.var fs = require('fs');
var child_process = require('child_process')

if ( process.avar fs = require('fs');
var child_process = require('child_process')

if ( process.arvar fs = require('fs');
var child_process = require('child_process')

if ( process.argvar fs = require('fs');
var child_process = require('child_process')

if ( process.argvvar fs = require('fs');
var child_process = require('child_process')

if ( process.argv[var fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ var fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2var fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 var fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ]var fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] var fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] &var fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] &&var fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && var fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && pvar fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && prvar fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && provar fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && procvar fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && procevar fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && procesvar fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && processvar fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && process.var fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && process.avar fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && process.arvar fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && process.argvar fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && process.argvvar fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && process.argv[var fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && process.argv[ var fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && process.argv[ 3var fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && process.argv[ 3 var fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && process.argv[ 3 ]var fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && process.argv[ 3 ] var fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && process.argv[ 3 ] )var fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && process.argv[ 3 ] ) var fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && process.argv[ 3 ] ) {var fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && process.argv[ 3 ] ) {
var fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && process.argv[ 3 ] ) {
 var fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && process.argv[ 3 ] ) {
  var fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && process.argv[ 3 ] ) {
  vvar fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && process.argv[ 3 ] ) {
  vavar fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && process.argv[ 3 ] ) {
  varvar fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && process.argv[ 3 ] ) {
  var var fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && process.argv[ 3 ] ) {
  var ivar fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && process.argv[ 3 ] ) {
  var invar fs = require('fs');
var child_process = require('child_process')

if ( process.argv[ 2 ] && process.argv[ 3 ] ) {
  var inF<|endoftext|>


<commit_before>const crypto = require('crypto')

/**
 * @module Util
 */
module.exports = {
  /**
   * Performs string formatting for things like custom nicknames.
   *
   * @param {string} formatString The string to format (contains replacement strings)
   * @param {object} data The data to replace the string replacements with
   * @param {GuildMember} member The guild member this string is being formatted for
   * @returns {string} The processed string
   */
  formatDataString (formatString, data, member) {
    let replacements = {
      '%USERNAME%': data.robloxUsername,
      '%USERID%': data.robloxId,
      '%RANK%': data.groupRank || '',
      '%DISCORDNAME%': data.discordName || '',
      '%DISCORDID%': data.discordId || ''
    }

    if (member != null) {
      replacements['%DISCORDNAME%'] = member.user.username
      replacements['%DISCORDID%'] = member.id
      replacements['%SERVER%'] = member.guild.name
    }

    return formatString.replace(/%\w+%/g, (all) => {
      return replacements[all] || all
    })
  },

  /**
   * Returns a promise that resolves after the given time in milliseconds.
   * @param {int} sleepTime The amount of time until the promise resolves
   * @returns Promise
   */
  async sleep (sleepTime) {
    return new Promise(resolve => {
      setTimeout(resolve, sleepTime)
    })
  },

  /**
   * Takes an array of numbers and simplifies it into a string containing ranges, e.g.:
   * [0, 1, 2, 4, 6, 7, 8] --> "0-2, 4, 6-8"
   * @param {array} numbers The input numbers
   * @returns {string} The output string
   */
  simplifyNumbers (numbers) {
    let output = []
    let rangeStart
    for (let i = 0; i < numbers.length; i++) {
      let number = numbers[i]
      let next = numbers[i + 1]

      if (rangeStart != null && (next - number !== 1 || next == null)) {
        output.push(`${rangeStart}-${number}`)
        rangeStart = null
      } else if (next == null || next - number !== 1) {
        output.push(`${number}`)
      } else if (rangeStart == null) {
        rangeStart = number
      }
    }

    return output.join(', ')
  },

  /**
   * Returns an md5 hash of the input string.
   * This is used for a key for a group binding. The key is the hash of the json of the rank binding.
   * @param {string} string The input string.
   * @returns {string} The md5 hash of the string.
   */
  md5 (string) {
    return crypto.createHash('md5').update(string).digest('hex')
  },

  /**
   * Gets group rank binding text for a binding.
   * Turns a rank binding object into a human-readable format.
   * @param {object} binding The binding object.
   * @param {boolean} [addCodeBlock=false] Whether or not to wrap the binding in markdown code block.
   * @returns {string} The binding in human-readable format.
   */
  getBindingText (binding, addCodeBlock = false) {
    let bindingMessage = addCodeBlock ? '```markdown\n' : ''

    if (binding.groups == null) {
      return `\nInvalid Group Format - Unbind role ${binding.role} to fix this problem.\n`
    }

    for (let [index, group] of binding.groups.entries()) {
      if (index > 0) bindingMessage += '...or\n'

      if (group.id.match(/[a-z]/i)) {
        bindingMessage += `# Virtual Group ${group.id}\n`
        bindingMessage += `Argument ${group.ranks.length > 0 ? group.ranks[0] : 'none'}`
      } else {
        bindingMessage += `# Group ${group.id}\n`
        bindingMessage += `Rank${group.ranks.length === 1 ? '' : 's'} ` + module.exports.simplifyNumbers(group.ranks)
      }
      bindingMessage += '\n\n'
    }

    return addCodeBlock ? bindingMessage + '\n```' : bindingMessage
  },

  /**
   * Gets the user-facing link for the verification registry.
   * This is not used for actually checking against the registry.
   * This is for functionality in the future where we want to know where the user came from to help make sure that
   * they are on the right account on the website by making sure the user is in the guild they came from.
   * @param {Guild} guild The guild this link is being generated for.
   * @returns {string} The link to the verification site
   */
  getVerifyLink (guild) {
    return `https://verify.eryn.io` // /?from=${guild.id}`
  }
}
<commit_msg>useless attempt<commit_after>const crypto = require('crypto')

/**
 * @module Util
 */
module.exports = {
  /**
   * Performs string formatting for things like custom nicknames.
   *
   * @param {string} formatString The string to format (contains replacement strings)
   * @param {object} data The data to replace the string replacements with
   * @param {GuildMember} member The guild member this string is being formatted for
   * @returns {string} The processed string
   */
  formatDataString (formatString, data, member) {
    let replacements = {
      '%USERNAME%': data.robloxUsername,
      '%USERID%': data.robloxId,
      '%RANK%': data.groupRank || "",
      '%DISCORDNAME%': data.discordName || '',
      '%DISCORDID%': data.discordId || ''
    }

    if (member != null) {
      replacements['%DISCORDNAME%'] = member.user.username
      replacements['%DISCORDID%'] = member.id
      replacements['%SERVER%'] = member.guild.name
    }

    return formatString.replace(/%\w+%/g, (all) => {
      return replacements[all] || all
    })
  },

  /**
   * Returns a promise that resolves after the given time in milliseconds.
   * @param {int} sleepTime The amount of time until the promise resolves
   * @returns Promise
   */
  async sleep (sleepTime) {
    return new Promise(resolve => {
      setTimeout(resolve, sleepTime)
    })
  },

  /**
   * Takes an array of numbers and simplifies it into a string containing ranges, e.g.:
   * [0, 1, 2, 4, 6, 7, 8] --> "0-2, 4, 6-8"
   * @param {array} numbers The input numbers
   * @returns {string} The output string
   */
  simplifyNumbers (numbers) {
    let output = []
    let rangeStart
    for (let i = 0; i < numbers.length; i++) {
      let number = numbers[i]
      let next = numbers[i + 1]

      if (rangeStart != null && (next - number !== 1 || next == null)) {
        output.push(`${rangeStart}-${number}`)
        rangeStart = null
      } else if (next == null || next - number !== 1) {
        output.push(`${number}`)
      } else if (rangeStart == null) {
        rangeStart = number
      }
    }

    return output.join(', ')
  },

  /**
   * Returns an md5 hash of the input string.
   * This is used for a key for a group binding. The key is the hash of the json of the rank binding.
   * @param {string} string The input string.
   * @returns {string} The md5 hash of the string.
   */
  md5 (string) {
    return crypto.createHash('md5').update(string).digest('hex')
  },

  /**
   * Gets group rank binding text for a binding.
   * Turns a rank binding object into a human-readable format.
   * @param {object} binding The binding object.
   * @param {boolean} [addCodeBlock=false] Whether or not to wrap the binding in markdown code block.
   * @returns {string} The binding in human-readable format.
   */
  getBindingText (binding, addCodeBlock = false) {
    let bindingMessage = addCodeBlock ? '```markdown\n' : ''

    if (binding.groups == null) {
      return `\nInvalid Group Format - Unbind role ${binding.role} to fix this problem.\n`
    }

    for (let [index, group] of binding.groups.entries()) {
      if (index > 0) bindingMessage += '...or\n'

      if (group.id.match(/[a-z]/i)) {
        bindingMessage += `# Virtual Group ${group.id}\n`
        bindingMessage += `Argument ${group.ranks.length > 0 ? group.ranks[0] : 'none'}`
      } else {
        bindingMessage += `# Group ${group.id}\n`
        bindingMessage += `Rank${group.ranks.length === 1 ? '' : 's'} ` + module.exports.simplifyNumbers(group.ranks)
      }
      bindingMessage += '\n\n'
    }

    return addCodeBlock ? bindingMessage + '\n```' : bindingMessage
  },

  /**
   * Gets the user-facing link for the verification registry.
   * This is not used for actually checking against the registry.
   * This is for functionality in the future where we want to know where the user came from to help make sure that
   * they are on the right account on the website by making sure the user is in the guild they came from.
   * @param {Guild} guild The guild this link is being generated for.
   * @returns {string} The link to the verification site
   */
  getVerifyLink (guild) {
    return `https://verify.eryn.io` // /?from=${guild.id}`
  }
}
<|endoftext|>


<commit_before>var child_process = require('child_process')
var fs = require('fs');
var max_sleep = 300
var step = 10
//Added a comment that achieves no real goal.
//Non-blocking loop
//Adjustable step
//Status line
//Add a rough time indicator
//First cut at libfaketime support

var commit_messages = [
  "Fixing an important issue with the universe.",
  "Someone poisoned the waterhole!",
  "You feeling lucky punk?",
  "Five bullets or six?",
  "Fixed memory parsing error #1337",
  "Cleaned out the intertubes",
  "AAAAAAAAAAARGH!",
  "Fixed a typo",
  "Updated the readme",
  "Fixing a typo added in the last readme update",
  "GET A HAIRCUT!",
  "Updated the readme again",
  "Found an issue with the letter 'a', so I fixed it.",
  "Incompatible dimensions found, Cthuhlu Error 666",
  "Who you calling a fool?",
  "How many more of these can I make?",
  "Fixing an error introduced in the last commit",
  "Re-updating the readme.",
  "Work in Progress",
  "WIP",
  "Quick fix",
  "Grammar fix",
  "Fixing punctuation",
  "Correcting style",
  "Logic error",
  "Almost there",
  "Nearly got it",
  "Not quite working",
  "Ooops!",
  "Did I do that?",
  "Commit all the required changes",
  "Really commit all the required changes",
  "Should work now",
  "Back out the last commit",
  "Reverting changes",
  "One more time...",
  "Re-commiting last",
  "One more User Story done",
  "Can work my way through the Kanban",
  "Sprint complete",
  "Well that seemed pretty easy",
  "What do you mean you can't pack up the commit?",
  "Merge in master",
  "Fast-forwarding changes"
]

if ( process.argv[ 2 ] && process.argv[ 3 ] ) {
  var inFile = process.argv[ 2 ]
  var outFile = process.argv[ 3 ]
  if (inFile == outFile) {
    console.error("Aborted: infile and outfile must be different")
    return(-1);
  }
  if (process.argv [ 4 ]) max_sleep = process.argv [ 4 ]
  if (process.argv [ 5 ]) step = parseInt(process.argv [ 5 ])
  console.info("Writing from %s to %s, with up to %s seconds between commits of %s bytes", inFile, outFile, max_sleep, step)
  var outFD = fs.openSync(outFile, 'w')
  fs.readFile(inFile, function(err,data) {
    var length = data.length
    var commit_count = Math.ceil(length / step)
    var commit_time = commit_count * max_sleep / 2
    var commit_time_hour = Math.floor(commit_time / 3600)
    var commit_time_rem = commit_time - (commit_time_hour * 3600)
    var commit_time_min = Math.floor(commit_time_rem / 60)
    var commit_time_sec = commit_time_rem - (commit_time_min * 60)
    console.info("Input file is %s Bytes, this will generate %s commits and take approximately %s hours %s minutes %s seconds", length, commit_count, commit_time_hour, commit_time_min, commit_time_sec)
    var t_offset = 0
    if (process.env.FAKETIME) {
      // 20% buffer, to reduce the likelihood of going in to the future
      t_offset = commit_time * -1.2;
      faketime(t_offset);
    }
    try {
      child_process.execFileSync('git', ['add', outFile])
    } catch (e) {
      console.error("Couldn't add %s to git: %s", outFile, e)
    }
    var counter = 0
    process.stdout.write("Queueing up the first commit...\r");
    var timeout;
    if (process.env.FAKETIME) {
      faketime(t_offset);
      timeout = 20;
    } else {
      timeout = randomIntFromInterval(0, max_sleep) * 1000
    }
    setTimeout(commit, timeout, t_offset, outFD, outFile, data, counter, length);
  })
} else {
  console.info("Usage:")
  console.info("node commit.js infile outfile [max_time_in_seconds] [step]")
}

function sleep(seconds) {
  var endTime = new Date().getTime() + (seconds * 1000);
  while (new Date().getTime() <= endTime) {;}
}

function randomIntFromInterval(min,max)
{
   return Math.floor(Math.random()*(max-min+1)+min);
}

function commit(t_offset, outFD, outFile, data, counter, length)
{
  if (counter < length)
  {
    var message = commit_messages[randomIntFromInterval(0, commit_messages.length - 1)]
    var args = ['commit', outFile, '-m', message]
    if (counter + step >= length) step = length - counter
    process.stdout.write("\033[2K Writing " + counter + "/" + length + " bytes: " + message + "\r");
    fs.wri<commit_msg>Cleaned out the intertubes<commit_after>var child_process = require('child_process')
var fs = require('fs');
var max_sleep = 300
var step = 10
//Added a comment that achieves no real goal.
//Non-blocking loop
//Adjustable step
//Status line
//Add a rough time indicator
//First cut at libfaketime support

var commit_messages = [
  "Fixing an important issue with the universe.",
  "Someone poisoned the waterhole!",
  "You feeling lucky punk?",
  "Five bullets or six?",
  "Fixed memory parsing error #1337",
  "Cleaned out the intertubes",
  "AAAAAAAAAAARGH!",
  "Fixed a typo",
  "Updated the readme",
  "Fixing a typo added in the last readme update",
  "GET A HAIRCUT!",
  "Updated the readme again",
  "Found an issue with the letter 'a', so I fixed it.",
  "Incompatible dimensions found, Cthuhlu Error 666",
  "Who you calling a fool?",
  "How many more of these can I make?",
  "Fixing an error introduced in the last commit",
  "Re-updating the readme.",
  "Work in Progress",
  "WIP",
  "Quick fix",
  "Grammar fix",
  "Fixing punctuation",
  "Correcting style",
  "Logic error",
  "Almost there",
  "Nearly got it",
  "Not quite working",
  "Ooops!",
  "Did I do that?",
  "Commit all the required changes",
  "Really commit all the required changes",
  "Should work now",
  "Back out the last commit",
  "Reverting changes",
  "One more time...",
  "Re-commiting last",
  "One more User Story done",
  "Can work my way through the Kanban",
  "Sprint complete",
  "Well that seemed pretty easy",
  "What do you mean you can't pack up the commit?",
  "Merge in master",
  "Fast-forwarding changes"
]

if ( process.argv[ 2 ] && process.argv[ 3 ] ) {
  var inFile = process.argv[ 2 ]
  var outFile = process.argv[ 3 ]
  if (inFile == outFile) {
    console.error("Aborted: infile and outfile must be different")
    return(-1);
  }
  if (process.argv [ 4 ]) max_sleep = process.argv [ 4 ]
  if (process.argv [ 5 ]) step = parseInt(process.argv [ 5 ])
  console.info("Writing from %s to %s, with up to %s seconds between commits of %s bytes", inFile, outFile, max_sleep, step)
  var outFD = fs.openSync(outFile, 'w')
  fs.readFile(inFile, function(err,data) {
    var length = data.length
    var commit_count = Math.ceil(length / step)
    var commit_time = commit_count * max_sleep / 2
    var commit_time_hour = Math.floor(commit_time / 3600)
    var commit_time_rem = commit_time - (commit_time_hour * 3600)
    var commit_time_min = Math.floor(commit_time_rem / 60)
    var commit_time_sec = commit_time_rem - (commit_time_min * 60)
    console.info("Input file is %s Bytes, this will generate %s commits and take approximately %s hours %s minutes %s seconds", length, commit_count, commit_time_hour, commit_time_min, commit_time_sec)
    var t_offset = 0
    if (process.env.FAKETIME) {
      // 20% buffer, to reduce the likelihood of going in to the future
      t_offset = commit_time * -1.2;
      faketime(t_offset);
    }
    try {
      child_process.execFileSync('git', ['add', outFile])
    } catch (e) {
      console.error("Couldn't add %s to git: %s", outFile, e)
    }
    var counter = 0
    process.stdout.write("Queueing up the first commit...\r");
    var timeout;
    if (process.env.FAKETIME) {
      faketime(t_offset);
      timeout = 20;
    } else {
      timeout = randomIntFromInterval(0, max_sleep) * 1000
    }
    setTimeout(commit, timeout, t_offset, outFD, outFile, data, counter, length);
  })
} else {
  console.info("Usage:")
  console.info("node commit.js infile outfile [max_time_in_seconds] [step]")
}

function sleep(seconds) {
  var endTime = new Date().getTime() + (seconds * 1000);
  while (new Date().getTime() <= endTime) {;}
}

function randomIntFromInterval(min,max)
{
   return Math.floor(Math.random()*(max-min+1)+min);
}

function commit(t_offset, outFD, outFile, data, counter, length)
{
  if (counter < length)
  {
    var message = commit_messages[randomIntFromInterval(0, commit_messages.length - 1)]
    var args = ['commit', outFile, '-m', message]
    if (counter + step >= length) step = length - counter
    process.stdout.write("\033[2K Writing " + counter + "/" + length + " bytes: " + message + "\r");
    fs.writ<|endoftext|>


<commit_before>var child_process = require('child_process')
var fs = require('fs');
var max_sleep = 300
var step = 10
//Added a comment that achieves no real goal.
//Non-blocking loop
//Adjustable step
//Status line
//Add a rough time indicator
//First cut at libfaketime support

var commit_messages = [
  "Fixing an important issue with the universe.",
  "Someone poisoned the waterhole!",
  "You feeling lucky punk?",
  "Five bullets or six?",
  "Fixed memory parsing error #1337",
  "Cleaned out the intertubes",
  "AAAAAAAAAAARGH!",
  "Fixed a typo",
  "Updated the readme",
  "Fixing a typo added in the last readme update",
  "GET A HAIRCUT!",
  "Updated the readme again",
  "Found an issue with the letter 'a', so I fixed it.",
  "Incompatible dimensions found, Cthuhlu Error 666",
  "Who you calling a fool?",
  "How many more of these can I make?",
  "Fixing an error introduced in the last commit",
  "Re-updating the readme.",
  "Work in Progress",
  "WIP",
  "Quick fix",
  "Grammar fix",
  "Fixing punctuation",
  "Correcting style",
  "Logic error",
  "Almost there",
  "Nearly got it",
  "Not quite working",
  "Ooops!",
  "Did I do that?",
  "Commit all the required changes",
  "Really commit all the required changes",
  "Should work now",
  "Back out the last commit",
  "Reverting changes",
  "One more time...",
  "Re-commiting last",
  "One more User Story done",
  "Can work my way through the Kanban",
  "Sprint complete",
  "Well that seemed pretty easy",
  "What do you mean you can't pack up the commit?",
  "Merge in master",
  "Fast-forwarding changes"
]

if ( process.argv[ 2 ] && process.argv[ 3 ] ) {
  var inFile = process.argv[ 2 ]
  var outFile = process.argv[ 3 ]
  if (inFile == outFile) {
    console.error("Aborted: infile and outfile must be different")
    return(-1);
  }
  if (process.argv [ 4 ]) max_sleep = process.argv [ 4 ]
  if (process.argv [ 5 ]) step = parseInt(process.argv [ 5 ])
  console.info("Writing from %s to %s, with up to %s seconds between commits of %s bytes", inFile, outFile, max_sleep, step)
  var outFD = fs.openSync(outFile, 'w')
  fs.readFile(inFile, function(err,data) {
    var length = data.length
    var commit_count = Math.ceil(length / step)
    var commit_time = commit_count * max_sleep / 2
    var commit_time_hour = Math.floor(commit_<commit_msg>Reverting changes<commit_after>var child_process = require('child_process')
var fs = require('fs');
var max_sleep = 300
var step = 10
//Added a comment that achieves no real goal.
//Non-blocking loop
//Adjustable step
//Status line
//Add a rough time indicator
//First cut at libfaketime support

var commit_messages = [
  "Fixing an important issue with the universe.",
  "Someone poisoned the waterhole!",
  "You feeling lucky punk?",
  "Five bullets or six?",
  "Fixed memory parsing error #1337",
  "Cleaned out the intertubes",
  "AAAAAAAAAAARGH!",
  "Fixed a typo",
  "Updated the readme",
  "Fixing a typo added in the last readme update",
  "GET A HAIRCUT!",
  "Updated the readme again",
  "Found an issue with the letter 'a', so I fixed it.",
  "Incompatible dimensions found, Cthuhlu Error 666",
  "Who you calling a fool?",
  "How many more of these can I make?",
  "Fixing an error introduced in the last commit",
  "Re-updating the readme.",
  "Work in Progress",
  "WIP",
  "Quick fix",
  "Grammar fix",
  "Fixing punctuation",
  "Correcting style",
  "Logic error",
  "Almost there",
  "Nearly got it",
  "Not quite working",
  "Ooops!",
  "Did I do that?",
  "Commit all the required changes",
  "Really commit all the required changes",
  "Should work now",
  "Back out the last commit",
  "Reverting changes",
  "One more time...",
  "Re-commiting last",
  "One more User Story done",
  "Can work my way through the Kanban",
  "Sprint complete",
  "Well that seemed pretty easy",
  "What do you mean you can't pack up the commit?",
  "Merge in master",
  "Fast-forwarding changes"
]

if ( process.argv[ 2 ] && process.argv[ 3 ] ) {
  var inFile = process.argv[ 2 ]
  var outFile = process.argv[ 3 ]
  if (inFile == outFile) {
    console.error("Aborted: infile and outfile must be different")
    return(-1);
  }
  if (process.argv [ 4 ]) max_sleep = process.argv [ 4 ]
  if (process.argv [ 5 ]) step = parseInt(process.argv [ 5 ])
  console.info("Writing from %s to %s, with up to %s seconds between commits of %s bytes", inFile, outFile, max_sleep, step)
  var outFD = fs.openSync(outFile, 'w')
  fs.readFile(inFile, function(err,data) {
    var length = data.length
    var commit_count = Math.ceil(length / step)
    var commit_time = commit_count * max_sleep / 2
    var commit_time_hour = Math.floor(commit_t<|endoftext|>


<commit_before>/**
 * Copyright 2013-2015, Facebook, Inc.
 * All rights reserved.
 *
 * This source code is licensed under the BSD-style license found in the
 * LICENSE file in the root directory of this source tree. An additional grant
 * of patent rights can be found in the PATENTS file in the same directory.
 *
 * @providesModule getMarkupWrap
 */

var ExecutionEnvironment = require('ExecutionEnvironment');

var invariant = require('invariant');

/**
 * Dummy container used to detect which wraps are necessary.
 */
var dummyNode =
  ExecutionEnvironment.canUseDOM ? document.createElement('div') : null;

/**
 * Some browsers cannot use `innerHTML` to render certain elements standalone,
 * so we wrap them, render the wrapped nodes, then extract the desired node.
 *
 * In IE8, certain elements cannot render alone, so wrap all elements ('*').
 */

var shouldWrap = {};

var selectWrap = [1, '<select multiple="true">', '</select>'];
var tableWrap = [1, '
', '
'];
var trWrap = [3, '

', '

'];

var svgWrap = [1, '<svg xmlns="http://www.w3.org/2000/svg">', '</svg>'];

var markupWrap = {
  '*': [1, '?
', '
'],

  'area': [1, '<map>', '</map>'],
  'col': [2, '

<colgroup>', '</colgroup>
'],
  'legend': [1, '<fieldset>', '</fieldset>'],
  'param': [1, '<object>', '</object>'],
  'tr': [2, '

', '

'],

  'optgroup': selectWrap,
  'option': selectWrap,

  'caption': tableWrap,
  'colgroup': tableWrap,
  'tbody': tableWrap,
  'tfoot': tableWrap,
  'thead': tableWrap,

  'td': trWrap,
  'th': trWrap,
};

// Initilize the SVG elements since we know they'll always need to be wrapped
// consistently. If they are created inside a
 they will be initialized in
// the wrong namespace (and will not display).
var svgElements = [
  'circle',
  'clipPath',
  'defs',
  'ellipse',
  'g',
  'line',
  'linearGradient',
  'path',
  'polygon',
  'polyline',
  'radialGradient',
  'rect',
  'stop',
  'text',
];
svgElements.forEach((nodeName) => {
  markupWrap[nodeName] = svgWrap;
  shouldWrap[nodeName] = true;
});

/**
 * Gets the markup wrap configuration for the supplied `nodeName`.
 *
 * NOTE: This lazily detects which wraps are necessary for the current browser.
 *
 * @param {string} nodeName Lowercase `nodeName`.
 * @return {?array} Markup wrap configuration, if applicable.
 */
function getMarkupWrap(nodeName) {
  invariant(!!dummyNode, 'Markup wrapping node not initialized');
  if (!markupWrap.hasOwnProperty(nodeName)) {
    nodeName = '*';
  }
  if (!shouldWrap.hasOwnProperty(nodeName)) {
    if (nodeName === '*') {
      dummyNode.innerHTML = '<link />';
    } else {
      dummyNode.innerHTML = '<' + nodeName + '></' + nodeName + '>';
    }
    shouldWrap[nodeName] = !dummyNode.firstChild;
  }
  return shouldWrap[nodeName] ? markupWrap[nodeName] : null;
}

module.exports = getMarkupWrap;
<commit_msg>Update getMarkupWrap with list of SVG supported in ReactDOM<commit_after>/**
 * Copyright 2013-2015, Facebook, Inc.
 * All rights reserved.
 *
 * This source code is licensed under the BSD-style license found in the
 * LICENSE file in the root directory of this source tree. An additional grant
 * of patent rights can be found in the PATENTS file in the same directory.
 *
 * @providesModule getMarkupWrap
 */

var ExecutionEnvironment = require('ExecutionEnvironment');

var invariant = require('invariant');

/**
 * Dummy container used to detect which wraps are necessary.
 */
var dummyNode =
  ExecutionEnvironment.canUseDOM ? document.createElement('div') : null;

/**
 * Some browsers cannot use `innerHTML` to render certain elements standalone,
 * so we wrap them, render the wrapped nodes, then extract the desired node.
 *
 * In IE8, certain elements cannot render alone, so wrap all elements ('*').
 */

var shouldWrap = {};

var selectWrap = [1, '<select multiple="true">', '</select>'];
var tableWrap = [1, '
', '
'];
var trWrap = [3, '

', '

'];

var svgWrap = [1, '<svg xmlns="http://www.w3.org/2000/svg">', '</svg>'];

var markupWrap = {
  '*': [1, '?
', '
'],

  'area': [1, '<map>', '</map>'],
  'col': [2, '

<colgroup>', '</colgroup>
'],
  'legend': [1, '<fieldset>', '</fieldset>'],
  'param': [1, '<object>', '</object>'],
  'tr': [2, '

', '

'],

  'optgroup': selectWrap,
  'option': selectWrap,

  'caption': tableWrap,
  'colgroup': tableWrap,
  'tbody': tableWrap,
  'tfoot': tableWrap,
  'thead': tableWrap,

  'td': trWrap,
  'th': trWrap,
};

// Initilize the SVG elements since we know they'll always need to be wrapped
// consistently. If they are created inside a
 they will be initialized in
// the wrong namespace (and will not display).
var svgElements = [
  'circle',
  'clipPath',
  'defs',
  'ellipse',
  'g',
  'line',
  'linearGradient',
  'mask',
  'path',
  'pattern',
  'polygon',
  'polyline',
  'radialGradient',
  'rect',
  'stop',
  'text',
  'tspan',
];
svgElements.forEach((nodeName) => {
  markupWrap[nodeName] = svgWrap;
  shouldWrap[nodeName] = true;
});

/**
 * Gets the markup wrap configuration for the supplied `nodeName`.
 *
 * NOTE: This lazily detects which wraps are necessary for the current browser.
 *
 * @param {string} nodeName Lowercase `nodeName`.
 * @return {?array} Markup wrap configuration, if applicable.
 */
function getMarkupWrap(nodeName) {
  invariant(!!dummyNode, 'Markup wrapping node not initialized');
  if (!markupWrap.hasOwnProperty(nodeName)) {
    nodeName = '*';
  }
  if (!shouldWrap.hasOwnProperty(nodeName)) {
    if (nodeName === '*') {
      dummyNode.innerHTML = '<link />';
    } else {
      dummyNode.innerHTML = '<' + nodeName + '></' + nodeName + '>';
    }
    shouldWrap[nodeName] = !dummyNode.firstChild;
  }
  return shouldWrap[nodeName] ? markupWrap[nodeName] : null;
}

module.exports = getMarkupWrap;
<|endoftext|>


<commit_before>var child_process = require('child_process')
var fs = require('fs');
var max_sleep = 300
var step = 10
//Added a comment that achieves no real goal.
//Non-blocking loop
//Adjustable step
//Status line
//Add a rough time indicator
//First cut at libfaketime support

var commit_messages = [
  "Fixing an important issue with the universe.",
  "Someone poisoned the waterhole!",
  "You feeling lucky punk?",
  "Five bullets or six?",
  "Fixed memory parsing error #1337",
  "Cleaned out the intertubes",
  "AAAAAAAAAAARGH!",
  "Fixed a typo",
  "Updated the readme",
  "Fixing a typo added in the last readme update",
  "GET A HAIRCUT!",
  "Updated the readme again",
  "Found an issue with the letter 'a', so I fixed it.",
  "Incompatible dimensions found, Cthuhlu Error 666",
  "Who you calling a fool?",
  "How many more of these can I make?",
  "Fixing an error introduced in the l<commit_msg>Updated the readme again<commit_after>var child_process = require('child_process')
var fs = require('fs');
var max_sleep = 300
var step = 10
//Added a comment that achieves no real goal.
//Non-blocking loop
//Adjustable step
//Status line
//Add a rough time indicator
//First cut at libfaketime support

var commit_messages = [
  "Fixing an important issue with the universe.",
  "Someone poisoned the waterhole!",
  "You feeling lucky punk?",
  "Five bullets or six?",
  "Fixed memory parsing error #1337",
  "Cleaned out the intertubes",
  "AAAAAAAAAAARGH!",
  "Fixed a typo",
  "Updated the readme",
  "Fixing a typo added in the last readme update",
  "GET A HAIRCUT!",
  "Updated the readme again",
  "Found an issue with the letter 'a', so I fixed it.",
  "Incompatible dimensions found, Cthuhlu Error 666",
  "Who you calling a fool?",
  "How many more of these can I make?",
  "Fixing an error introduced in the la<|endoftext|>


<commit_before>var fs = require('fs');
var child_process = require('child_process')
var max_sleep = 300
//Added a comment that achieves no real goal.

var commit_messages = [
  "Fixing an important issue with the universe.",
  "Someone poisoned the waterhole!",
  "You feeling lucky punk?",
  "Five bullets or six?",
  "Fixed memory parsing error #1337",
  "Cleaned out the intertubes",
  "AAAAAAAAAAARGH!",
  "Fixed a typo",
  "Updated the readme",
  "Fixing a typo added in the last readme update",
  "GET A HAIRCUT!",
  "Updated the readme again",
  "Found an issue with the letter 'a', so I fixed it.",
  "Incompatible dimensions found, Cthuhlu Error 666",
  "Who you calling a fool?",
  "How many more of these can I make?",
  "Fixing an error introduced in the last commit",
  "Re-updating the readme.",
  "Work in Progress",
  "WIP",
  "Quick fix",
  "Grammar fix",
  "Fixing punctuation",
  "Correcting style",
  "Logic error"
]

if ( process.argv[ 2 ] && process.argv[ 3 ] ) {
  var inFile = process.argv[ 2 ]
  var outFile = process.argv[ 3 ]
  if (process.argv [ 4 ]) max_sleep = process.argv [ 4 ]
  console.info("Writing from %s to %s, with up to %s seconds between commits", inFile, outFile, max_sleep)
  var outFD = fs.openSync(outFile, 'w')
  fs.readFile(inFile, function(err,data) {
    var length = data.length
    console.info("Bytes: %s", length)
    try {
      child_process.execFileSync('/usr/bin/git', ['add', outFile])
    } catch (e) {
      console.error("Couldn't add %s to git: %s", outFile, e)
    }
    var message = commit_messages[randomIntFromInterval(0, commit_messages.length - 1)]
    var args = ['commit', outFile, '-m', message]
    for (var counter = 0; counter < length; counter++)
    {
      var message = commit_messages[randomIntFromInterval(0, commit_messages.length - 1)]
      var args = ['commit', outFile, '-m', message]
      fs.writeSync(outFD, data.slice(counter, counter+1), 0, 1)
      sleep(Math.random() * max_sleep)
      child_process.execFile<commit_msg>Cleaned out the intertubes<commit_after>var fs = require('fs');
var child_process = require('child_process')
var max_sleep = 300
//Added a comment that achieves no real goal.

var commit_messages = [
  "Fixing an important issue with the universe.",
  "Someone poisoned the waterhole!",
  "You feeling lucky punk?",
  "Five bullets or six?",
  "Fixed memory parsing error #1337",
  "Cleaned out the intertubes",
  "AAAAAAAAAAARGH!",
  "Fixed a typo",
  "Updated the readme",
  "Fixing a typo added in the last readme update",
  "GET A HAIRCUT!",
  "Updated the readme again",
  "Found an issue with the letter 'a', so I fixed it.",
  "Incompatible dimensions found, Cthuhlu Error 666",
  "Who you calling a fool?",
  "How many more of these can I make?",
  "Fixing an error introduced in the last commit",
  "Re-updating the readme.",
  "Work in Progress",
  "WIP",
  "Quick fix",
  "Grammar fix",
  "Fixing punctuation",
  "Correcting style",
  "Logic error"
]

if ( process.argv[ 2 ] && process.argv[ 3 ] ) {
  var inFile = process.argv[ 2 ]
  var outFile = process.argv[ 3 ]
  if (process.argv [ 4 ]) max_sleep = process.argv [ 4 ]
  console.info("Writing from %s to %s, with up to %s seconds between commits", inFile, outFile, max_sleep)
  var outFD = fs.openSync(outFile, 'w')
  fs.readFile(inFile, function(err,data) {
    var length = data.length
    console.info("Bytes: %s", length)
    try {
      child_process.execFileSync('/usr/bin/git', ['add', outFile])
    } catch (e) {
      console.error("Couldn't add %s to git: %s", outFile, e)
    }
    var message = commit_messages[randomIntFromInterval(0, commit_messages.length - 1)]
    var args = ['commit', outFile, '-m', message]
    for (var counter = 0; counter < length; counter++)
    {
      var message = commit_messages[randomIntFromInterval(0, commit_messages.length - 1)]
      var args = ['commit', outFile, '-m', message]
      fs.writeSync(outFD, data.slice(counter, counter+1), 0, 1)
      sleep(Math.random() * max_sleep)
      child_process.execFileS<|endoftext|>


<commit_before>var fs = require('fs');
var child_process = require('child_process')
var max_sleep = 300
var step = 10
//Added a comment that achieves no real goal.
//Non-blocking loop
//Adjustable step
//Status line
//Add a rough time indicator

var commit_messages = [
  "Fixing an important issue with the universe.",
  "Someone poisoned the waterhole!",
  "You feeling lucky punk?",
  "Five bullets or six?",
  "Fixed memory parsing error #1337",
  "Cleaned out the intertubes",
  "AAAAAAAAAAARGH!",
  "Fixed a typo",
  "Updated the readme",
  "Fixing a typo added in the last readme update",
  "GET A HAIRCUT!",
  "Updated the readme again",
  "Found an issue with the letter 'a', so I fixed it.",
  "Incompatible dimensions found, Cthuhlu Error 666",
  "Who you calling a fool?",
  "How many more of these can I make?",
  "Fixing an error introduced in the last commit",
  "Re-updating the readme.",
  "Work in Progress",
  "WIP",
  "Quick fix",
  "Grammar fix",
  "Fixing punctuation",
  "Correcting style",
  "Logic error",
  "Almost there",
  "Nearly got it",
  "Not quite working",
  "Ooops!",
  "Did I do that?",
  "Commit all the required changes",
  "Really commit all the required changes",
  "Should work now",
  "Back out the last commit",
  "Reverting changes",
  "One more time...",
  "Re-commiting last",
  "One more User Story done",
  "Can work my way through the Kanban",
  "Sprint complete",
  "Well that seemed pretty easy",
  "What do you mean you can't pack up the commit?",
  "Merge in master",
  "Fast-forwar<commit_msg>Fixing an important issue with the universe.<commit_after>var fs = require('fs');
var child_process = require('child_process')
var max_sleep = 300
var step = 10
//Added a comment that achieves no real goal.
//Non-blocking loop
//Adjustable step
//Status line
//Add a rough time indicator

var commit_messages = [
  "Fixing an important issue with the universe.",
  "Someone poisoned the waterhole!",
  "You feeling lucky punk?",
  "Five bullets or six?",
  "Fixed memory parsing error #1337",
  "Cleaned out the intertubes",
  "AAAAAAAAAAARGH!",
  "Fixed a typo",
  "Updated the readme",
  "Fixing a typo added in the last readme update",
  "GET A HAIRCUT!",
  "Updated the readme again",
  "Found an issue with the letter 'a', so I fixed it.",
  "Incompatible dimensions found, Cthuhlu Error 666",
  "Who you calling a fool?",
  "How many more of these can I make?",
  "Fixing an error introduced in the last commit",
  "Re-updating the readme.",
  "Work in Progress",
  "WIP",
  "Quick fix",
  "Grammar fix",
  "Fixing punctuation",
  "Correcting style",
  "Logic error",
  "Almost there",
  "Nearly got it",
  "Not quite working",
  "Ooops!",
  "Did I do that?",
  "Commit all the required changes",
  "Really commit all the required changes",
  "Should work now",
  "Back out the last commit",
  "Reverting changes",
  "One more time...",
  "Re-commiting last",
  "One more User Story done",
  "Can work my way through the Kanban",
  "Sprint complete",
  "Well that seemed pretty easy",
  "What do you mean you can't pack up the commit?",
  "Merge in master",
  "Fast-forwarding changes"
]

if ( process.argv[ 2 ] <|endoftext|>


<commit_before>import File from './File';

export default class Package extends File {

  async templateRepo() {
    const content = await this.originalContent({
      ignoreMissing: true
    });
    const pkg = JSON.parse(content);
    if (pkg.template !== undefined && pkg.template.repository !== undefined) {
      const m = pkg.template.repository.url.match(/github.com\/(.*)\.git$/);
      return m[1];
    }

    return undefined;
  }

  get merge() {
    return Promise.all([this.originalContent({
      ignoreMissing: true
    }), this.templateContent()]).then(contents => {
      const original = contents[0];
      let target = contents[0] === undefined || contents[0] === '' ? {} : JSON.parse(contents[0]);
      const template = JSON.parse(contents[1]);
      const messages = [];

      const properties = this.context.properties;

      if (target.name === undefined || target.name === '') {
        const m = this.context.targetRepo.match(/^([^\/]+)\/(.*)/);
        target.name = m ? m[2] : this.context.targetRepo;
      }

      if (target.module !== undefined && !target.module.match(/\{\{module\}\}/)) {
        properties.module = target.module;
      }

      properties.main = target.main && !target.main.match(/\{\{main\}\}/) ? target.main : 'dist/index.js';

      let extraBuild, buildOutput;

      if (target.scripts !== undefined) {
        [target.scripts.build, target.scripts.prepublish].filter(s => s !== undefined).forEach(script => {
          const ma = script.match(/--output=([^\s]+)/);
          if (ma) {
            buildOutput = ma[1];
          }

          const mb = script.match(/&&\s*(.+)/);
          if (mb) {
            extraBuild = mb[1];
          }
        });

        delete target.scripts.build;
      }

      const deepPropeties = {
        scripts: {},
        devDependencies: {},
        engines: {}
      };

      Object.keys(deepPropeties).forEach(p => {
        if (target[p] === undefined) {
          target[p] = {};
        }

        if (template[p] !== undefined) {
          Object.keys(template[p]).forEach(d => {
            if (template[p][d] === '-') {
              if (target[p][d] !== undefined) {
                messages.push(`chore(${p}): remove ${d}@${target[p][d]}`);
                delete target[p][d];
              }
            } else {
              const tp = this.context.expand(template[p][d]);
              if (tp !== target[p][d]) {
                messages.push(target[p][d] === undefined ? `chore(${p}): add ${d}@${tp} from template` :
                  `chore(${p}): update ${d}@${tp} from template`);
                target[p][d] = tp;
              }
            }
          });
        }
      });

      Object.keys(template).forEach(p => {
        if (p !== 'template') {
          if (target[p] === undefined) {
            target[p] = template[p];
          }
        }
      });

      if (target.scripts.prepublish) {
        if (buildOutput !== undefined) {
          target.scripts.prepublish = target.scripts.prepublish.replace(/--output=([^\s]+)/,
            `--output=${buildOutput}`);
        }
        if (extraBuild !== undefined) {
          target.scripts.prepublish += ` && ${extraBuild}`;
        }
      }

      if (target.module === '{{module}}') {
        delete target.module;
      }

      if (target.contributors !== undefined && target.author !== undefined && target.author.name !== undefined) {
        const m = target.author.name.match(/(^[^<]+)<([^>]+)>/);
        if (m !== undefined) {
          const name = String(m[1]).replace(/^\s+|\s+$/g, '');
          const email = m[2];

          if (target.contributors.find(c => c.name === name && c.email === email)) {
            delete target.author;
          }
        }
      }

      if (target.keywords !== undefined) {
        delete target.keywords['npm-package-template'];
      }

      if (template.template !== undefined && template.template.keywords !== undefined) {
        Object.keys(template.template.keywords).forEach(r =>
          addKeyword(target, new RegExp(r), template.template.keywords[r], messages)
        );
      }

      removeKeyword(target, ["null"], messages);

      if (target.template === undefined || target.template.repository === undefined ||
        target.template.repository.url !== `https://github.com/${this.context.templateRepo}.git`) {
        messages.push('chore: set template repo');

        target.template = {
          repository: {
            url: `https://github.com/${this.context.templateRepo}.git`
          }
        };
      }

      const rcj = this.context.files.get('rollup.config.js');
      const first = rcj === undefined ? Promise.resolve() :
        rcj.merge.then(m => {
          if (m.content) {
            if (!m.content.match(/rollup-plugin-node-resolve/)) {
              delete target.devDependencies['rollup-plugin-node-resolve'];
            }
            if (!m.content.match(/rollup-plugin-commonjs/)) {
              delete target.devDependencies['rollup-plugin-commonjs'];
            }
          }
        });

      target = deleter(target, template, messages, []);

      if (messages.length === 0) {
        messages.push('chore: update package.json from template');
      }

      return first.then(() => {
        const content = JSON.stringify(this.context.expand(target), undefined, 2);
        return {
          content,
          messages,
          path: this.path,
            changed: original !== content
        };
      });
    });
  }
}

function deleter(object, reference, messages, path) {
  if (typeof object === 'string' || object instanceof String ||
    object === true || object === false || object === undefined || object === null ||
    typeof object === 'number' || object instanceof Number) {
    return object;
  }

  Object.keys(reference).forEach(key => {
    path.push(key);

    if (reference[key] === '--delete--') {
      delete object[key];
      messages.push(`chore(npm): delete ${path.join('.')}`);
    } else {
      object[key] = deleter(object[key], reference[key], messages, path);
    }
    path.pop();
  });

  return object;
}

function removeKeyword(pkg, keywords, messages) {
  if (pkg.keywords !== undefined) {
    keywords.forEach(keyword => {
      if (pkg.keywords.find(k => k === keyword)) {
        messages.push(`docs(package): remove keyword ${keyword}`);
        pkg.keywords = pkg.keywords.filter(k => k !== keyword);
      }
    });
  }
}

function addKeyword(pkg, regex, keyword, messages) {
  if (pkg.name.match(regex)) {
    if (pkg.keywords === undefined) {
      pkg.keywords = [];
    }
    if (!pkg.keywords.find(k => k === keyword)) {
      messages.push(`docs(package): add keyword ${keyword}`);
      pkg.keywords.push(keyword);
    }
  }
}
<commit_msg>refactor(package): move keyword hnadling towards the end of the function<commit_after>import File from './File';

export default class Package extends File {

  async templateRepo() {
    const content = await this.originalContent({
      ignoreMissing: true
    });
    const pkg = JSON.parse(content);
    if (pkg.template !== undefined && pkg.template.repository !== undefined) {
      const m = pkg.template.repository.url.match(/github.com\/(.*)\.git$/);
      return m[1];
    }

    return undefined;
  }

  get merge() {
    return Promise.all([this.originalContent({
      ignoreMissing: true
    }), this.templateContent()]).then(contents => {
      const original = contents[0];
      let target = contents[0] === undefined || contents[0] === '' ? {} : JSON.parse(contents[0]);
      const template = JSON.parse(contents[1]);
      const messages = [];

      const properties = this.context.properties;

      if (target.name === undefined || target.name === '') {
        const m = this.context.targetRepo.match(/^([^\/]+)\/(.*)/);
        target.name = m ? m[2] : this.context.targetRepo;
      }

      if (target.module !== undefined && !target.module.match(/\{\{module\}\}/)) {
        properties.module = target.module;
      }

      properties.main = target.main && !target.main.match(/\{\{main\}\}/) ? target.main : 'dist/index.js';

      let extraBuild, buildOutput;

      if (target.scripts !== undefined) {
        [target.scripts.build, target.scripts.prepublish].filter(s => s !== undefined).forEach(script => {
          const ma = script.match(/--output=([^\s]+)/);
          if (ma) {
            buildOutput = ma[1];
          }

          const mb = script.match(/&&\s*(.+)/);
          if (mb) {
            extraBuild = mb[1];
          }
        });

        delete target.scripts.build;
      }

      const deepPropeties = {
        scripts: {},
        devDependencies: {},
        engines: {}
      };

      Object.keys(deepPropeties).forEach(p => {
        if (target[p] === undefined) {
          target[p] = {};
        }

        if (template[p] !== undefined) {
          Object.keys(template[p]).forEach(d => {
            if (template[p][d] === '-') {
              if (target[p][d] !== undefined) {
                messages.push(`chore(${p}): remove ${d}@${target[p][d]}`);
                delete target[p][d];
              }
            } else {
              const tp = this.context.expand(template[p][d]);
              if (tp !== target[p][d]) {
                messages.push(target[p][d] === undefined ? `chore(${p}): add ${d}@${tp} from template` :
                  `chore(${p}): update ${d}@${tp} from template`);
                target[p][d] = tp;
              }
            }
          });
        }
      });

      Object.keys(template).forEach(p => {
        if (p !== 'template') {
          if (target[p] === undefined) {
            target[p] = template[p];
          }
        }
      });

      if (target.scripts.prepublish) {
        if (buildOutput !== undefined) {
          target.scripts.prepublish = target.scripts.prepublish.replace(/--output=([^\s]+)/,
            `--output=${buildOutput}`);
        }
        if (extraBuild !== undefined) {
          target.scripts.prepublish += ` && ${extraBuild}`;
        }
      }

      if (target.module === '{{module}}') {
        delete target.module;
      }

      if (target.contributors !== undefined && target.author !== undefined && target.author.name !== undefined) {
        const m = target.author.name.match(/(^[^<]+)<([^>]+)>/);
        if (m !== undefined) {
          const name = String(m[1]).replace(/^\s+|\s+$/g, '');
          const email = m[2];

          if (target.contributors.find(c => c.name === name && c.email === email)) {
            delete target.author;
          }
        }
      }

      if (target.template === undefined || target.template.repository === undefined ||
        target.template.repository.url !== `https://github.com/${this.context.templateRepo}.git`) {
        messages.push('chore: set template repo');

        target.template = {
          repository: {
            url: `https://github.com/${this.context.templateRepo}.git`
          }
        };
      }

      const rcj = this.context.files.get('rollup.config.js');
      const first = rcj === undefined ? Promise.resolve() :
        rcj.merge.then(m => {
          if (m.content) {
            if (!m.content.match(/rollup-plugin-node-resolve/)) {
              delete target.devDependencies['rollup-plugin-node-resolve'];
            }
            if (!m.content.match(/rollup-plugin-commonjs/)) {
              delete target.devDependencies['rollup-plugin-commonjs'];
            }
          }
        });

      target = deleter(target, template, messages, []);

      if (target.keywords !== undefined) {
        delete target.keywords['npm-package-template'];
      }

      if (template.template !== undefined && template.template.keywords !== undefined) {
        Object.keys(template.template.keywords).forEach(r =>
          addKeyword(target, new RegExp(r), template.template.keywords[r], messages)
        );
      }

      removeKeyword(target, ['null'], messages);

      if (messages.length === 0) {
        messages.push('chore: update package.json from template');
      }

      return first.then(() => {
        const content = JSON.stringify(this.context.expand(target), undefined, 2);
        return {
          content,
          messages,
          path: this.path,
            changed: original !== content
        };
      });
    });
  }
}

function deleter(object, reference, messages, path) {
  if (typeof object === 'string' || object instanceof String ||
    object === true || object === false || object === undefined || object === null ||
    typeof object === 'number' || object instanceof Number) {
    return object;
  }

  Object.keys(reference).forEach(key => {
    path.push(key);

    if (reference[key] === '--delete--') {
      delete object[key];
      messages.push(`chore(npm): delete ${path.join('.')}`);
    } else {
      object[key] = deleter(object[key], reference[key], messages, path);
    }
    path.pop();
  });

  return object;
}

function removeKeyword(pkg, keywords, messages) {
  if (pkg.keywords !== undefined) {
    keywords.forEach(keyword => {
      if (pkg.keywords.find(k => k === keyword)) {
        messages.push(`docs(package): remove keyword ${keyword}`);
        pkg.keywords = pkg.keywords.filter(k => k !== keyword);
      }
    });
  }
}

function addKeyword(pkg, regex, keyword, messages) {
  if (pkg.name.match(regex)) {
    if (pkg.keywords === undefined) {
      pkg.keywords = [];
    }
    if (!pkg.keywords.find(k => k === keyword)) {
      messages.push(`docs(package): add keyword ${keyword}`);
      pkg.keywords.push(keyword);
    }
  }
}
<|endoftext|>


<commit_before>var fs = require('fs');
var child_process = require('child_process')
var max_sleep = 300
var step = 10
//Added a comment that achieves no real goal.
//Non-blocking loop
//Adjustable step
//Status line
//Add a rough time indicator

var commit_messages = [
  "Fixing an important issue with the universe.",
  "Someone poisoned the waterhole!",
  "You feeling lucky punk?",
  "Five bullets or six?",
  "Fixed memory parsing error #1337",
  "Cleaned out the intertubes",
  "AAAAAAAAAAARGH!",
  "Fixed a typo",
  "Updated the readme",
  "Fixing a typo added in the last readme update",
  "GET A HAIRCUT!",
  "Updated the readme again",
  "Found an issue with the letter 'a', so I fixed it.",
  "Incompatible dimensions found, Cthuhlu Error 666",
  "Who you calling a fool?",
  "How many more of these can I make?",
  "Fixing an error introduced in the last commit",
  "Re-updating the readme.",
  "Work in Progress",
  "WIP",
  "Quick fix",
  "Grammar fix",
  "Fixing punctuation",
  "Correcting style",
  "Logic error",
  "Almost there",
  "Nearly got it",
  "Not quite working",
  "Ooops!",
  "Did I do that?",
  "Commit all the required changes",
  "Really commit all the required changes",
  "Should work now",
  "Back out the last commit",
  "Reverting changes",
  "One more time...",
  "Re-commiting last"
]

if ( process.argv[ 2 ] && process.argv[ 3 ] ) {
  var inFile = process.argv[ 2 ]
  var outFile = process.argv[ 3 ]
  if (inFile == outFile) {
    console.error("Aborted: infile and outfile must be different")
    return(-1);
  }
  if (process.argv [ 4 ]) max_sleep = process.argv [ 4 ]
  if (process.argv [ 5 ]) step = parseInt(process.argv [ 5 ])
  console.info("Writing from %s to %s, with up to %s seconds between commits of %s bytes", inFile, outFile, max_sleep, step)
  var outFD = fs.openSync(outFile, 'w')
  fs.readFile(inFile, function(err,data) {
    var length = data.length
    var commit_count = Math.ceil(length / step)
    var commit_time = commit_count * max_sleep / 2
    var commit_time_hour = Math.floor(commit_time / 3600)
    var commit_time_rem = commit_time - (commit_time_hour * 3600)
    var commit_time_min = Math.floor(commit_time_rem / 60)
    var commit_time_sec = commit_time_rem - (commit_time_min * 60)
    console.info("Input file is %s Bytes, this will generate %s commits and take approximately %s hours %s minutes %s seconds", length, commit_count, commit_time_hour, commit_time_min, commit_time_sec)
    try {
      child_process.execFileSync('/usr/bin/git', ['add', outFile])
    } catch (e) {
      console.error("Couldn't add %s to git: %s", outFile, e)
    }
    var timeout = randomIntFromInterval(0, max_sleep) * 1000
    var counter = 0
    process.stdout.write("Queueing up the first commit...\r");
    setTimeout(commit, timeout, outFD, outFile,<commit_msg>Fixed a typo<commit_after>var fs = require('fs');
var child_process = require('child_process')
var max_sleep = 300
var step = 10
//Added a comment that achieves no real goal.
//Non-blocking loop
//Adjustable step
//Status line
//Add a rough time indicator

var commit_messages = [
  "Fixing an important issue with the universe.",
  "Someone poisoned the waterhole!",
  "You feeling lucky punk?",
  "Five bullets or six?",
  "Fixed memory parsing error #1337",
  "Cleaned out the intertubes",
  "AAAAAAAAAAARGH!",
  "Fixed a typo",
  "Updated the readme",
  "Fixing a typo added in the last readme update",
  "GET A HAIRCUT!",
  "Updated the readme again",
  "Found an issue with the letter 'a', so I fixed it.",
  "Incompatible dimensions found, Cthuhlu Error 666",
  "Who you calling a fool?",
  "How many more of these can I make?",
  "Fixing an error introduced in the last commit",
  "Re-updating the readme.",
  "Work in Progress",
  "WIP",
  "Quick fix",
  "Grammar fix",
  "Fixing punctuation",
  "Correcting style",
  "Logic error",
  "Almost there",
  "Nearly got it",
  "Not quite working",
  "Ooops!",
  "Did I do that?",
  "Commit all the required changes",
  "Really commit all the required changes",
  "Should work now",
  "Back out the last commit",
  "Reverting changes",
  "One more time...",
  "Re-commiting last"
]

if ( process.argv[ 2 ] && process.argv[ 3 ] ) {
  var inFile = process.argv[ 2 ]
  var outFile = process.argv[ 3 ]
  if (inFile == outFile) {
    console.error("Aborted: infile and outfile must be different")
    return(-1);
  }
  if (process.argv [ 4 ]) max_sleep = process.argv [ 4 ]
  if (process.argv [ 5 ]) step = parseInt(process.argv [ 5 ])
  console.info("Writing from %s to %s, with up to %s seconds between commits of %s bytes", inFile, outFile, max_sleep, step)
  var outFD = fs.openSync(outFile, 'w')
  fs.readFile(inFile, function(err,data) {
    var length = data.length
    var commit_count = Math.ceil(length / step)
    var commit_time = commit_count * max_sleep / 2
    var commit_time_hour = Math.floor(commit_time / 3600)
    var commit_time_rem = commit_time - (commit_time_hour * 3600)
    var commit_time_min = Math.floor(commit_time_rem / 60)
    var commit_time_sec = commit_time_rem - (commit_time_min * 60)
    console.info("Input file is %s Bytes, this will generate %s commits and take approximately %s hours %s minutes %s seconds", length, commit_count, commit_time_hour, commit_time_min, commit_time_sec)
    try {
      child_process.execFileSync('/usr/bin/git', ['add', outFile])
    } catch (e) {
      console.error("Couldn't add %s to git: %s", outFile, e)
    }
    var timeout = randomIntFromInterval(0, max_sleep) * 1000
    var counter = 0
    process.stdout.write("Queueing up the first commit...\r");
    setTimeout(commit, timeout, outFD, outFile, data, counter, length);
  })
} else {
  console.i<|endoftext|>


<commit_before>var child_process = require('child_process')
var fs = require('fs');
var max_sleep = 300
var step = 10
//Added a comment that achieves no real goal.
//Non-blocking loop
//Adjustable step
//Status line
//Add a rough time indicator
//First cut at libfaketime support

var commit_messages = [
  "Fixing an important issue with the universe.",
  "Someone poisoned the waterhole!",
  "You feeling lucky punk?",
  "Five bullets or six?",
  "Fixed memory parsing error #1337",
  "Cleaned out the intertubes",
  "AAAAAAAAAAARGH!",
  "Fixed a typo",
  "Updated the readme",
  "Fixing a typo added in the last readme update",
  "GET A HAIRCUT!",
  "Updated the readme again",
  "Found an issue with the letter 'a', so I fixed it.",
  "Incompatible dimensions found, Cthuhlu Error 666",
  "Who you calling a fool?",
  "How many more of these can I make?",
  "Fixing an error introduced in the last commit",
  "Re-updating the readme.",
  "Work in Progress",
  "WIP",
  "Quick fix",
  "Grammar fix",
  "Fixing punctuation",
  "Correcting style",
  "Logic error",
  "Almost there",
  "Nearly got it",
  "Not quite working",
  "Ooops!",
  "Did I do that?",
  "Commit all the required changes",
  "Really commit all the required changes",
  "Should work now",
  "Back out the last commit",
  "Reverting changes",
  "One more time...",
  "Re-commiting last",
  "One more User Story done",
  "Can work my way through the Kanban",
  "Sprint complete",
  "Well that seemed pretty easy",
  "What do you mean you can't pack up the commit?",
  "Merge in master",
  "Fast-forwarding changes"
]

if ( process.argv[ 2 ] && process.argv[ 3 ] ) {
  var inFile = process.argv[ 2 ]
  var outFile = process.argv[ 3 ]
  if (inFile == outFile) {
    console.error("Aborted: infile and outfile must be different")
    return(-1);
  }
  if (process.argv [ 4 ]) max_sleep = process.argv [ 4 ]
  if (process.argv [ 5 ]) step = parseInt(process.argv [ 5 ])
  console.info("Writing from %s to %s, with up to %s seconds between commits of %s bytes", inFile, outFile, max_sleep, step)
  var outFD = fs.openSync(outFile, 'w')
  fs.readFile(inFile, function(err,data) {
    var length = data.length
    var commit_count = Math.ceil(length / step)
    var commit_time = commit_count * max_sleep / 2
    var commit_time_hour = Math.floor(commit_time / 3600)
    var commit_time_rem = commit_time - (commit_time_hour * 3600)
    var commit_time_min = Math.floor(commit_time_rem / 60)
    var commit_time_sec = commit_time_rem - (commit_time_min * 60)
    console.info("Input file is %s Bytes, this will generate %s commits and take approximately %s hours %s minutes %s seconds", length, commit_count, commit_time_hour, commit_time_min, commit_time_sec)
    var t_offset = 0
    if (process.env.FAKETIME) {
      // 20% buffer, to reduce the likelihood of going in to the future
      t_offset = commit_time * -1.2;
      faketime(t_offset);
    }
    try {
      child_process.execFileSync('git', ['add', outFile])
    } catch (e) {
      console.error("Couldn't add %s to git: %s", outFile, e)
    }
    var counter = 0
    process.stdout.write("Queueing up the first commit...\r");
    var timeout;
    if (process.env.FAKETIME) {
      faketime(t_offset);
      timeout = 20;
    } else {
      timeout = randomIntFromInterval(0, max_sleep) * 1000
    }
    setTimeout(commit, timeout, t_offset, outFD, outFile, data, counter, length);
  })
} else {
  console.info("Usage:")
  console.info("node commit.js infile outfile [max_time_in_se<commit_msg>Nearly got it<commit_after>var child_process = require('child_process')
var fs = require('fs');
var max_sleep = 300
var step = 10
//Added a comment that achieves no real goal.
//Non-blocking loop
//Adjustable step
//Status line
//Add a rough time indicator
//First cut at libfaketime support

var commit_messages = [
  "Fixing an important issue with the universe.",
  "Someone poisoned the waterhole!",
  "You feeling lucky punk?",
  "Five bullets or six?",
  "Fixed memory parsing error #1337",
  "Cleaned out the intertubes",
  "AAAAAAAAAAARGH!",
  "Fixed a typo",
  "Updated the readme",
  "Fixing a typo added in the last readme update",
  "GET A HAIRCUT!",
  "Updated the readme again",
  "Found an issue with the letter 'a', so I fixed it.",
  "Incompatible dimensions found, Cthuhlu Error 666",
  "Who you calling a fool?",
  "How many more of these can I make?",
  "Fixing an error introduced in the last commit",
  "Re-updating the readme.",
  "Work in Progress",
  "WIP",
  "Quick fix",
  "Grammar fix",
  "Fixing punctuation",
  "Correcting style",
  "Logic error",
  "Almost there",
  "Nearly got it",
  "Not quite working",
  "Ooops!",
  "Did I do that?",
  "Commit all the required changes",
  "Really commit all the required changes",
  "Should work now",
  "Back out the last commit",
  "Reverting changes",
  "One more time...",
  "Re-commiting last",
  "One more User Story done",
  "Can work my way through the Kanban",
  "Sprint complete",
  "Well that seemed pretty easy",
  "What do you mean you can't pack up the commit?",
  "Merge in master",
  "Fast-forwarding changes"
]

if ( process.argv[ 2 ] && process.argv[ 3 ] ) {
  var inFile = process.argv[ 2 ]
  var outFile = process.argv[ 3 ]
  if (inFile == outFile) {
    console.error("Aborted: infile and outfile must be different")
    return(-1);
  }
  if (process.argv [ 4 ]) max_sleep = process.argv [ 4 ]
  if (process.argv [ 5 ]) step = parseInt(process.argv [ 5 ])
  console.info("Writing from %s to %s, with up to %s seconds between commits of %s bytes", inFile, outFile, max_sleep, step)
  var outFD = fs.openSync(outFile, 'w')
  fs.readFile(inFile, function(err,data) {
    var length = data.length
    var commit_count = Math.ceil(length / step)
    var commit_time = commit_count * max_sleep / 2
    var commit_time_hour = Math.floor(commit_time / 3600)
    var commit_time_rem = commit_time - (commit_time_hour * 3600)
    var commit_time_min = Math.floor(commit_time_rem / 60)
    var commit_time_sec = commit_time_rem - (commit_time_min * 60)
    console.info("Input file is %s Bytes, this will generate %s commits and take approximately %s hours %s minutes %s seconds", length, commit_count, commit_time_hour, commit_time_min, commit_time_sec)
    var t_offset = 0
    if (process.env.FAKETIME) {
      // 20% buffer, to reduce the likelihood of going in to the future
      t_offset = commit_time * -1.2;
      faketime(t_offset);
    }
    try {
      child_process.execFileSync('git', ['add', outFile])
    } catch (e) {
      console.error("Couldn't add %s to git: %s", outFile, e)
    }
    var counter = 0
    process.stdout.write("Queueing up the first commit...\r");
    var timeout;
    if (process.env.FAKETIME) {
      faketime(t_offset);
      timeout = 20;
    } else {
      timeout = randomIntFromInterval(0, max_sleep) * 1000
    }
    setTimeout(commit, timeout, t_offset, outFD, outFile, data, counter, length);
  })
} else {
  console.info("Usage:")
  console.info("node commit.js infile outfile [max_time_in_sec<|endoftext|>


<commit_before>var child_process = require('child_process')
var fs = require('fs');
var max_sleep = 300
var step = 10
//Added a comment that achieves no real goal.
//Non-blocking loop
//Adjustable step
//Status line
//Add a rough time indicator
//First cut at libfaketime support

var commit_messages = [
  "Fixing an important issue with the universe.",
  "Someone poisoned the waterhole!",
  "You feeling lucky punk?",
  "Five bullets or six?",
  "Fixed memory parsing error #1337",
  "Cleaned out the intertubes",
  "AAAAAAAAAAARGH!",
  "Fixed a typo",
  "Updated the readme",
  "Fixing a typo added in the last readme update",
  "GET A HAIRCUT!",
  "Updated the readme again",
  "Found an issue with the letter 'a', so I fixed it.",
  "Incompatible dimensions found, Cthuhlu Error 666",
  "Who you calling a fool?",
  "How many more of these can I make?",
  "Fixing an error introduced in the last commit",
  "Re-updating the readme.",
  "Work in Progress",
  "WIP",
  "Quick fix",
  "Grammar fix",
  "Fixing punctuation",
  "Correcting style",
  "Logic error",
  "Almost there",
  "Nearly got it",
  "Not quite working",
  "Ooops!",
  "Did I do that?",
  "Commit all the required changes",
  "Really commit all the required changes",
  "Should work now",
  "Back out the last commit",
  "Reverting changes",
  "One more time...",
  "Re-commiting last",
  "One more User Story done",
  "Can work my way through the Kanban",
  "Sprint complete",
  "Well that seemed pretty easy",
  "What do you mean you can't pack up the commit?",
  "Merge in master",
  "Fast-forwarding changes"
]

if ( process.argv[ 2 ] && process.argv[ 3 ] ) {
  var inFile = process.argv[ 2 ]
  var outFile = process.argv[ 3 ]
  if (inFile == outFile) {
    console.error("Aborted: infile and outfile must be different")
    return(-1);
  }
  if (process.argv [ 4 ]) max_sleep = process.argv [ 4 ]
  if (process.argv [ 5 ]) step = parseInt(process.argv [ 5 ])
  console.info("Writing from %s to %s, with up to %s seconds between commits of %s bytes", inFile, outFile, max_sleep, step)
  var outFD = fs.openSync(outFile, 'w')
  fs.readFile(inFile, function(err,data) {
    var length = data.length
    var commit_count = Math.ceil(length / step)
    var commit_time = commit_count * max_sleep / 2
    var commit_time_hour = Math.floor(commit_time / 3600)
    var commit_time_rem = commit_time - (commit_time_hour * 3600)
    var commit_time_min = Math.floor(commit_time_rem / 60)
    var commit_time_sec = commit_time_rem - (commit_time_min * 60)
    console.info("Input file is %s Bytes, this will generate %s commits and take approximately %s hours %s minutes %s seconds", length, commit_count, commit_time_hour, commit_time_min, commit_time_sec)
    var t_offset = 0
    if (process.env.FAKETIME) {
      // 20% buffer, to reduce the likelihood of going in to the future
      t_offset = commit_time * -1.2;
      faketime(t_offset);
    }
    try {
      child_process.execF<commit_msg>Fast-forwarding changes<commit_after>var child_process = require('child_process')
var fs = require('fs');
var max_sleep = 300
var step = 10
//Added a comment that achieves no real goal.
//Non-blocking loop
//Adjustable step
//Status line
//Add a rough time indicator
//First cut at libfaketime support

var commit_messages = [
  "Fixing an important issue with the universe.",
  "Someone poisoned the waterhole!",
  "You feeling lucky punk?",
  "Five bullets or six?",
  "Fixed memory parsing error #1337",
  "Cleaned out the intertubes",
  "AAAAAAAAAAARGH!",
  "Fixed a typo",
  "Updated the readme",
  "Fixing a typo added in the last readme update",
  "GET A HAIRCUT!",
  "Updated the readme again",
  "Found an issue with the letter 'a', so I fixed it.",
  "Incompatible dimensions found, Cthuhlu Error 666",
  "Who you calling a fool?",
  "How many more of these can I make?",
  "Fixing an error introduced in the last commit",
  "Re-updating the readme.",
  "Work in Progress",
  "WIP",
  "Quick fix",
  "Grammar fix",
  "Fixing punctuation",
  "Correcting style",
  "Logic error",
  "Almost there",
  "Nearly got it",
  "Not quite working",
  "Ooops!",
  "Did I do that?",
  "Commit all the required changes",
  "Really commit all the required changes",
  "Should work now",
  "Back out the last commit",
  "Reverting changes",
  "One more time...",
  "Re-commiting last",
  "One more User Story done",
  "Can work my way through the Kanban",
  "Sprint complete",
  "Well that seemed pretty easy",
  "What do you mean you can't pack up the commit?",
  "Merge in master",
  "Fast-forwarding changes"
]

if ( process.argv[ 2 ] && process.argv[ 3 ] ) {
  var inFile = process.argv[ 2 ]
  var outFile = process.argv[ 3 ]
  if (inFile == outFile) {
    console.error("Aborted: infile and outfile must be different")
    return(-1);
  }
  if (process.argv [ 4 ]) max_sleep = process.argv [ 4 ]
  if (process.argv [ 5 ]) step = parseInt(process.argv [ 5 ])
  console.info("Writing from %s to %s, with up to %s seconds between commits of %s bytes", inFile, outFile, max_sleep, step)
  var outFD = fs.openSync(outFile, 'w')
  fs.readFile(inFile, function(err,data) {
    var length = data.length
    var commit_count = Math.ceil(length / step)
    var commit_time = commit_count * max_sleep / 2
    var commit_time_hour = Math.floor(commit_time / 3600)
    var commit_time_rem = commit_time - (commit_time_hour * 3600)
    var commit_time_min = Math.floor(commit_time_rem / 60)
    var commit_time_sec = commit_time_rem - (commit_time_min * 60)
    console.info("Input file is %s Bytes, this will generate %s commits and take approximately %s hours %s minutes %s seconds", length, commit_count, commit_time_hour, commit_time_min, commit_time_sec)
    var t_offset = 0
    if (process.env.FAKETIME) {
      // 20% buffer, to reduce the likelihood of going in to the future
      t_offset = commit_time * -1.2;
      faketime(t_offset);
    }
    try {
      child_process.execFi<|endoftext|>


<commit_before>var fs = require('fs');
var child_process = require('child_process')
var max_sleep = 300
var step = 10
//Added a comment that achieves no real goal.
//Non-blocking loop
//Adjustable step
//Status line
//Add a rough time indicator

var commit_messages = [
  "Fixing an important issue with the universe.",
  "Someone poisoned the waterhole!",
  "You feeling lucky punk?",
  "Five bullets or six?",
  "Fixed memory parsing error #1337",
  "Cleaned out the intertubes",
  "AAAAAAAAAAARGH!",
  "Fixed a typo",
  "Updated the readme",
  "Fixing a typo added in the last readme update",
  "GET A HAIRCUT!",
  "Updated the readme again",
  "Found an issue with the letter 'a', so I fixed it.",
  "Incompatible dimensions found, Cthuhlu Error 666",
  "Who you calling a fool?",
  "How many more of these can I make?",
  "Fixing an error introduced in the last commit",
  "Re-updating the readme.",
  "Work in Progress",
  "WIP",
  "Quick fix",
  "Grammar fix",
  "Fixing punctuation",
  "Correcting style",
  "Logic error",
  "Almost there",
  "Nearly got it",
  "Not quite working",
  "Ooops!",
  "Did I do that?",
  "Commit all the required changes",
  "Really commit all the required changes",
  "Should work now",
  "Back out the last commit",
  "Reverting changes"
]

if ( process.argv[ 2 ] && process.argv[ 3 ] ) {
  var inFile = process.argv[ 2 ]
  var outFile = process.argv[ 3 ]
  if (inFile == outFile) {
    console.error("Aborted: infile and outfile must be different")
    return(-1);
  }
  if (process.argv [ 4 ]) max_sleep = process.argv [ 4 ]
  if (process.argv [ 5 ]) step = parseInt(process.argv [ 5 ])
  console.info("Writing from %s to %s, with up to %s seconds between commits of %s bytes", inFile, outFile, max_sleep, step)
  var outFD = fs.openSync(outFile, 'w')
  fs.readFile(inFile, function(err,data) {
    var length = data.length
    var commit_count = Math.ceil(length / step)
    var commit_time = commit_count * max_sleep / 2
    var commit_time_hour = Math.floor(commit_time / 3600)
    var commit_time_rem = commit_time - (commit_time_hour * 3600)
    var commit_time_min = Math.floor(commit_time_rem / 60)
    var commit_time_sec = commit_time_rem - (commit_time_min * 60)
    console.info("Input file is %s Bytes, this will generate %s commits and take approximately %s hours %s minutes %s seconds", length, commit_count, commit_time_hour, commit_time_min, commit_time_sec)
    try {
      child_process.execFileSync('/usr/bin/git', ['add', outFile])
    } catch (e) {
      console.error("Couldn't add %s to git: %s", outFile, e)
    }
    var timeout = randomIntFromInterval(0, max_sleep) * 1000
    var counter = 0
    process.stdout.write("Queueing up the first commit...\r");
    setTimeout(commit, timeout, outFD, outFile, data, counter, length);
  })
} else {
  console.info("Usage:")
  console.info("node commit.js infile outfile [max_time_in_seconds] [step]")
}

function sleep(seconds) {
  var endTime = new Date().getTime() + (seconds * 1000);
  while (new Date().getTime() <= endTime) {;}
}

function randomIntFromInterval(min,max)
{
   return Math.floor(Math.random()*(max-min+1)+min);
}

function commit(outFD, outFile, data, counter, length)
{
  if (counter <commit_msg>You feeling lucky punk?<commit_after>var fs = require('fs');
var child_process = require('child_process')
var max_sleep = 300
var step = 10
//Added a comment that achieves no real goal.
//Non-blocking loop
//Adjustable step
//Status line
//Add a rough time indicator

var commit_messages = [
  "Fixing an important issue with the universe.",
  "Someone poisoned the waterhole!",
  "You feeling lucky punk?",
  "Five bullets or six?",
  "Fixed memory parsing error #1337",
  "Cleaned out the intertubes",
  "AAAAAAAAAAARGH!",
  "Fixed a typo",
  "Updated the readme",
  "Fixing a typo added in the last readme update",
  "GET A HAIRCUT!",
  "Updated the readme again",
  "Found an issue with the letter 'a', so I fixed it.",
  "Incompatible dimensions found, Cthuhlu Error 666",
  "Who you calling a fool?",
  "How many more of these can I make?",
  "Fixing an error introduced in the last commit",
  "Re-updating the readme.",
  "Work in Progress",
  "WIP",
  "Quick fix",
  "Grammar fix",
  "Fixing punctuation",
  "Correcting style",
  "Logic error",
  "Almost there",
  "Nearly got it",
  "Not quite working",
  "Ooops!",
  "Did I do that?",
  "Commit all the required changes",
  "Really commit all the required changes",
  "Should work now",
  "Back out the last commit",
  "Reverting changes"
]

if ( process.argv[ 2 ] && process.argv[ 3 ] ) {
  var inFile = process.argv[ 2 ]
  var outFile = process.argv[ 3 ]
  if (inFile == outFile) {
    console.error("Aborted: infile and outfile must be different")
    return(-1);
  }
  if (process.argv [ 4 ]) max_sleep = process.argv [ 4 ]
  if (process.argv [ 5 ]) step = parseInt(process.argv [ 5 ])
  console.info("Writing from %s to %s, with up to %s seconds between commits of %s bytes", inFile, outFile, max_sleep, step)
  var outFD = fs.openSync(outFile, 'w')
  fs.readFile(inFile, function(err,data) {
    var length = data.length
    var commit_count = Math.ceil(length / step)
    var commit_time = commit_count * max_sleep / 2
    var commit_time_hour = Math.floor(commit_time / 3600)
    var commit_time_rem = commit_time - (commit_time_hour * 3600)
    var commit_time_min = Math.floor(commit_time_rem / 60)
    var commit_time_sec = commit_time_rem - (commit_time_min * 60)
    console.info("Input file is %s Bytes, this will generate %s commits and take approximately %s hours %s minutes %s seconds", length, commit_count, commit_time_hour, commit_time_min, commit_time_sec)
    try {
      child_process.execFileSync('/usr/bin/git', ['add', outFile])
    } catch (e) {
      console.error("Couldn't add %s to git: %s", outFile, e)
    }
    var timeout = randomIntFromInterval(0, max_sleep) * 1000
    var counter = 0
    process.stdout.write("Queueing up the first commit...\r");
    setTimeout(commit, timeout, outFD, outFile, data, counter, length);
  })
} else {
  console.info("Usage:")
  console.info("node commit.js infile outfile [max_time_in_seconds] [step]")
}

function sleep(seconds) {
  var endTime = new Date().getTime() + (seconds * 1000);
  while (new Date().getTime() <= endTime) {;}
}

function randomIntFromInterval(min,max)
{
   return Math.floor(Math.random()*(max-min+1)+min);
}

function commit(outFD, outFile, data, counter, length)
{
  if (counter < length)
  {
    va<|endoftext|>


<commit_before>var assign = require('object-assign');
var baseRules = require('./base');
var rules = assign(baseRules, {
  'jsx-quotes': [2, 'prefer-single'],
  'react/jsx-no-bind': 1,
  'react/sort-comp': 0, // enable when https://github.com/yannickcr/eslint-plugin-react/issues/128 is fixed
});

module.exports = {
  extends: 'airbnb',
  rules: rules
};
<commit_msg>Enforce no curly spacing in jsx<commit_after>var assign = require('object-assign');
var baseRules = require('./base');
var rules = assign(baseRules, {
  'jsx-quotes': [2, 'prefer-single'],
  'react/jsx-curly-spacing': [2, 'never'],
  'react/jsx-no-bind': 1,
  'react/sort-comp': 0, // enable when https://github.com/yannickcr/eslint-plugin-react/issues/128 is fixed
});

module.exports = {
  extends: 'airbnb',
  rules: rules
};
<|endoftext|>