In ruby/grit, how do I get a list of files changed in a specific commit? -
i want list of files affected commit in git. through command line, can with:
git show --pretty="format:" --name-only (sha)
but how can through grit in ruby?
you can use your_commit.diffs
returns array of grit::diff
instances. grit::diff
has a_path
, b_path
properties.
some (untested) example code:
paths = []; @commit.diffs.each |diff| paths += [diff.a_path, diff.b_path] end paths.uniq!
Comments
Post a Comment