rough-vase-83553
11/16/2022, 11:35 PM./peek
? Might be a bit scope creepy but very useful for CI + there's already subsystem logic for Git. One use case I have in mind is raising a CI lint error if a Docker image target changes but its version number hasn't changed.happy-kitchen-89482
11/17/2022, 12:16 AM--changed-since
does?rough-vase-83553
11/17/2022, 12:21 AMgsw master && ./pants peek
+ some scripting.
main_tag=$(./pants peek --git-ref=main :tgt | jq ..)
head_tag=$(./pants peek :tgt | jq ..)
changed-since
. But much less trivial.happy-kitchen-89482
11/17/2022, 2:47 AMrough-vase-83553
11/17/2022, 2:49 AMhappy-kitchen-89482
11/17/2022, 2:49 AMrough-vase-83553
11/17/2022, 2:50 AM--changed-since
happy-kitchen-89482
11/17/2022, 2:54 AMrough-vase-83553
11/17/2022, 2:56 AM--changed-since=main
has all the same technical challenges and more? It has to read the merge base git ref and then compute some logical diff between that and the worktree./pants peek --git-ref=main
would be the same thing minus the logical diff. Unless I'm way off about how --changed-since
workshappy-kitchen-89482
11/17/2022, 3:00 AM--changed-since
only looks at which paths have changed, but not their content.rough-vase-83553
11/17/2022, 3:05 AMI'm a bit confused here. Are you saying it doesn't even look at the contents of BUILD files?only looks at which paths have changed, but not their content.--changed-since
commit f070e507e8b4bb2d4f44549d00be9f5936d1bd50
Author: Navneeth Jayendran <navneeth.jayendran@affirm.com>
Date: Wed Nov 16 19:04:40 2022 -0800
Update message
diff --git a/README.md b/README.md
index 716ed14..dd880bc 100644
--- a/README.md
+++ b/README.md
@@ -1 +1,3 @@
# Hello world
+
+Add some more content
commit 2d244ca0497b53065235b6f3efa0a9410a3de3e8
Author: Navneeth Jayendran <navneeth.jayendran@affirm.com>
Date: Wed Nov 16 19:04:23 2022 -0800
Initial commit
diff --git a/BUILD.pants b/BUILD.pants
new file mode 100644
index 0000000..2666440
--- /dev/null
+++ b/BUILD.pants
@@ -0,0 +1,4 @@
+file(
+ name="README",
+ source="README.md"
+)
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..716ed14
--- /dev/null
+++ b/README.md
@@ -0,0 +1 @@
+# Hello world
diff --git a/pants.toml b/pants.toml
new file mode 100644
index 0000000..8d269d8
--- /dev/null
+++ b/pants.toml
@@ -0,0 +1,2 @@
+[GLOBAL]
+pants_version = "2.14.0"
./pants list --changed-since HEAD~
, it shows that //:README
changes. The only change since previous commit was to modify README file contentshappy-kitchen-89482
11/17/2022, 3:15 AM--changed-since
behaves as if you had hand-edited all the files that have changed since the gitref--changed-since
rough-vase-83553
11/17/2022, 3:20 AMcurved-television-6568
11/17/2022, 2:13 PMworks as followsbazel-diff
• The previous revision is checked out, then we run. This gives us the hashmap representation for the entire Bazel graph, then we write this JSON to a file.generate-hashes
• Next we checkout the initial revision, then we runand write that JSON to a file. Now we have our final hashmap representation for the Bazel graph.generate-hashes
• We runon the starting and final JSON hash filepaths to get our impacted set of targets. This impacted set of targets is written to a file.bazel-diff