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

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -