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

Popular posts from this blog

delphi - TJvHidDeviceController "DevicePath" always showing "\" -

Disabling Android home button for industry application -

asp.net mvc 3 - Unexpected "foreach" keyword after "@" character -