Add changes-in-diffspec option to what-changed

Review Request #1535 - Created Dec. 20, 2014 and submitted

Information
David Taylor
pants
885
1534
e8dc10f...
Reviewers
pants-reviews
benjyw, dturner-tw, jsirois, patricklaw

Add an option to what-changed mixin that instead of looking at changes in the workspace,
relative to some parent ref/treeish, allows finding targets changed by some diffspec.

A diffspec is something that is meaningful to the scm, eg a commit SHA or a range, or
other ref/ref-range or similar. Pants makes no attempt to parse or understand diffspecs,
but rather just passes them through to an appropriate scm command.

For git, several examples of possible diffspec formats can be found on:
https://www.kernel.org/pub/software/scm/git/docs/gitrevisions.html

Exmaple usage:
pants goal what-changed --diffspec=HEAD
pants goal what-changed --diffspec=HEAD@{yesterday}
pants goal what-changed --diffspec=abcb913
pants goal what-changed --diffspec=HEAD~8..HEAD
pants goal what-changed --diffspec=v1.0.2..HEAD

Added a bunch of tests, most of which aren't actually testing any pants code but rather just
documenting some of the git behaviors we believe work, and in the process ensuring the git
command used to get this information from git indeed performs as expected.

https://travis-ci.org/pantsbuild/pants/builds/44684439

./pants goal test tests/python/pants_test/tasks:what_changed tests/python/pants_test/scm::

Issues

  • 0
  • 2
  • 1
  • 3
Description From Last Updated
Patrick Lawson
David Taylor
John Sirois
David Turner
David Taylor
David Taylor
David Taylor
David Turner
David Taylor
David Taylor
Review request changed

Status: Closed (submitted)

Change Summary:

c31650eca44aa0e7bf4687fd16ffb981be669a2e

Landed this for now. I'm confident it shouldn't break anything and I'd like to use it in a test for something else.

There are a couple questions below that we can revisit, but the interface changes are minimal enough that I think it should easy enough to revise if/when we come up with something better.

Loading...