Skip to content

Commit bedb544

Browse files
committed
Add documentation for new comparison strategy to README
1 parent 12a9c6d commit bedb544

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,14 +113,16 @@ affectedModuleDetector {
113113
- `logFilename`: A filename for the output detector to use
114114
- `logFolder`: A folder to output the log file in
115115
- `specifiedBranch`: A branch to specify changes against. Must be used in combination with configuration `compareFrom = "SpecifiedBranchCommit"`
116+
- `specifiedRawCommitSha`: A raw commit SHA to specify changes against. Must be used in combination with configuration `compareFrom = "SpecifiedRawCommitSha"`
116117
- `ignoredFiles`: A set of files that will be filtered out of the list of changed files retrieved by git.
117118
- `buildAllWhenNoProjectsChanged`: If true, the plugin will build all projects when no projects are considered affected.
118119
- `compareFrom`: A commit to compare the branch changes against. Can be either:
119120
- PreviousCommit: compare against the previous commit
120121
- ForkCommit: compare against the commit the branch was forked from
121122
- SpecifiedBranchCommit: compare against the last commit of `$specifiedBranch` using `git rev-parse` approach.
122123
- SpecifiedBranchCommitMergeBase: compare against the nearest ancestors with `$specifiedBranch` using `git merge base` approach.
123-
124+
- SpecifiedRawCommitSha: compare against the provided raw commit SHA.
125+
124126
**Note:** specify the branch to compare changes against using the `specifiedBranch` configuration before the `compareFrom` configuration
125127
- `excludedModules`: A list of modules that will be excluded from the build process, can be the name of a module, or a regex against the module gradle path
126128
- `includeUncommitted`: If uncommitted files should be considered affected
@@ -162,6 +164,12 @@ Suppose we have changed 6 files in our "feature" branch.
162164

163165
Hence, depending on your CI settings you have to configure AMD appropriately.
164166

167+
## SpecifiedRawCommitSha
168+
169+
If you want AMD plugin to skip performing the git operations under-the-hood (like `git rev-parse` and `git merge base`), you can provide the raw commit SHA you wish to compare against.
170+
One of the main reasons you might want to follow this approach is, maybe your environment leverages [Git mirroring](https://docs.github.com/en/repositories/creating-and-managing-repositories/duplicating-a-repository) for speed optimizations, for example CI/CD environments.
171+
Mirroring _can_ lead to inaccurate common ancestor commits as the duplicated repository _may be_ out of sync with the true remote repository.
172+
165173
## Sample Usage
166174

167175
Running the plugin generated tasks is quite simple. By default, if `affected_module_detector.enable` is not set,

0 commit comments

Comments
 (0)