   git.cmd(['whatchanged', '-1', '--name-status', '--format=%B'], {cwd})
   .then (amend) -> parse amend
   .then ([message, prevChangedFiles]) ->
-    getStagedFiles(repo).then (files) -> mergeFiles prevChangedFiles, files
+    getStagedFiles(repo)
+    .then (files) -> diffFiles prevChangedFiles, files
+    .then (prevChangedFiles) -> prettifyFileStatuses(prevChangedFiles)
+    .then (prevChangedFiles) ->
+      getGitStatus(repo).then (status) ->
+        prepFile message, prevChangedFiles, status, filePath
+    # .then showFile filePath
   .catch (msg) -> notifier.addInfo msg
   # .then (amend) ->getStagedFiles(repo)
   # .then (files) ->

  mode: data[0]
  path: data.substring(1)

getStagedFiles = (repo) ->
  git.stagedFiles(repo).then (files) ->
    if files.length >= 1

      prevChangedFiles.push line.replace(/[ MADRCU?!](\s)(\s)*/, line[0])
  [message.join('\n'), prevChangedFiles]

prepFile = (message, prevChangedFiles, status, filePath) ->
  git.cmd(['config', '--get', 'core.commentchar']).then (commentchar) ->
    commentchar = if commentchar.length > 0 then commentchar.trim() else '#'
    status = status
    .replace(/\s*\(.*\)\n/g, "\n")
    .replace(/\n/g, "\n#{commentchar} ")
    .replace "committed:\n#{commentchar}", """committed:
    #{
      prevChangedFiles.map((f) -> "#{commentchar}   #{f}").join("\n")
    }"""
    getTemplate().then (template) ->
      fs.writeFileSync filePath,
        """#{message}
        #{commentchar} Please enter the commit message for your changes. Lines starting
        #{commentchar} with '#{commentchar}' will be ignored, and an empty message aborts the commit.
        #{commentchar}
        #{commentchar} #{status}"""

