Method: GitCommitNotifier::Git.changed_files

Defined in:
lib/git_commit_notifier/git.rb

.changed_files(rev1, rev2) ⇒ Array(String)

Note:

uses "--pretty=oneline" and "--name-status" and "-M" options.

Runs git log and extract filenames only

Parameters:

  • rev1 (String)

    First revision

  • rev2 (String)

    Second revision

Returns:

  • (Array(String))

    File names

See Also:



72
73
74
75
76
# File 'lib/git_commit_notifier/git.rb', line 72

def changed_files(rev1, rev2)
  lines = lines_from_shell("git log #{rev1}..#{rev2} --name-status --pretty=oneline -M#{GitCommitNotifier::CommitHook.config['similarity_detection_threshold'] || "0.5"}")
  lines = lines.select { |line| line =~ /^\w{1}\s+\w+/ } # grep out only filenames
  lines.uniq
end