GitDiffLCS
Generally, git diff --stat does not contain modifications, so we added it to display modifications using the LCS algorithm.
Installation
$ gem install git_diff-lcs
How to use
CLI
$ git_diff_lcs diff [GIT_REPOSITORY] [SRC(BRANCH OR COMMIT)] [DEST(BRANCH OR COMMIT)]
$ git_diff_lcs diff https://github.com/btpink-seo/git-diff-lcs.git test/src test/dest
Ruby
GitDiffLCS.diff(repo, src, dest)
src, dest is branch name or commit
require 'git_diff_lcs'
GitDiffLCS.diff('https://github.com/btpink-seo/git-diff-lcs.git', 'test/src', 'test/dest')
# => 5 files changed, 13 insertions(+), 6 deletions(-), 2 modifications(!), total(21)
GitDiffLCS::Stat.new(repo, src, dest)
require 'git_diff_lcs'
stat = GitDiffLCS::Stat.new('https://github.com/btpink-seo/git-diff-lcs.git', 'test/src', 'test/dest')
stat.summary
# => 5 files changed, 13 insertions(+), 6 deletions(-), 2 modifications(!), total(21)
stat.insertions
# => 13
stat.deletions
# => 6
stat.modifications
# => 2