Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@dsabanin
Created July 22, 2013 19:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dsabanin/6056640 to your computer and use it in GitHub Desktop.
Save dsabanin/6056640 to your computer and use it in GitHub Desktop.
def diffs(repo, from, to)
repo.call_git("diff ?..?", from, to).stdout.
strip.
split(/diff --git.*?$/).
map(&:strip).
uniq.
map { |d| d.blank? ? nil : d }.
compact.
map { |d| [diff_head(d), d] }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment