You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+64-48
Original file line number
Diff line number
Diff line change
@@ -7,16 +7,18 @@
7
7
1.`bazel-diff` is designed for very large Bazel projects. We use Java Protobuf's `parseDelimitedFrom` method alongside Bazel Query's `streamed_proto` output option. These two together allow you to parse Gigabyte or larger protobuf messages. We have tested it with projects containing tens of thousands of targets.
8
8
2. We avoid usage of large command line query lists when interacting with Bazel, [issue here](https://github.com/bazelbuild/bazel/issues/8609). When you interact with Bazel with thousands of query parameters you can reach an upper maximum limit, seeing this error:
9
9
10
-
bash: /usr/local/bin/bazel: Argument list too long
10
+
```terminal
11
+
bash: /usr/local/bin/bazel: Argument list too long
12
+
```
11
13
12
-
`bazel-diff` is smart enough to prevent these errors
14
+
`bazel-diff` is smart enough to prevent these errors
13
15
3.`bazel-diff` has been tested with file renames, deletions, and modifications. Works on `bzl` files, `WORKSPACE` files, `BUILD` files and regular files
14
16
15
17
Track the feature request for target diffing in Bazel [here](https://github.com/bazelbuild/bazel/issues/7962)
16
18
17
19
This approach was inspired by the [following BazelConf talk](https://www.youtube.com/watch?v=9Dk7mtIm7_A) by Benjamin Peterson.
18
20
19
-
###Prerequisites
21
+
## Prerequisites
20
22
21
23
* Git
22
24
* Bazel 3.3.0 or higher
@@ -26,13 +28,16 @@ This approach was inspired by the [following BazelConf talk](https://www.youtube
26
28
27
29
To start using `bazel-diff` immediately, simply clone down the repo and then run the example shell script:
*`WORKSPACE_PATH`: Path to directory containing your `WORKSPACE` file in your Bazel project.
35
-
*Note: Your project must use Git for `bazel-diff` to work!
40
+
* Note: Your project must use Git for `bazel-diff` to work!
36
41
*`BAZEL_PATH`: Path to your Bazel executable
37
42
*`START_GIT_REVISION`: Starting Git Branch or SHA for your desired commit range
38
43
*`END_GIT_REVISION`: Final Git Branch or SHA for your desired commit range
@@ -46,6 +51,7 @@ Open `bazel-diff-example.sh` to see how this is implemented. This is purely an e
46
51
## How it works
47
52
48
53
`bazel-diff` works as follows
54
+
49
55
* The `modified-filepaths` command is used to fetch the modified filepaths between two Git revisions, we write this list of modified filepaths to a file.
50
56
51
57
* The previous revision is checked out, then we run `generate-hashes`. This gives us the hashmap representation for the entire Bazel graph, then we write this JSON to a file. We do not pass `modified-filepaths` here since it is the starting revision.
@@ -57,7 +63,8 @@ Open `bazel-diff-example.sh` to see how this is implemented. This is purely an e
java -jar bazel-bin/src/main/java/com/bazel_diff/bazel-diff_deploy.jar # This JAR can be run anywhere
167
178
```
@@ -170,44 +181,46 @@ java -jar bazel-bin/src/main/java/com/bazel_diff/bazel-diff_deploy.jar # This JA
170
181
171
182
Add the following to your `WORKSPACE` file to add the external repositories, replacing the `RELEASE_ARCHIVE_URL` with the archive url of the bazel-diff release you wish to depend on:
0 commit comments