Skip to content

Commit 23242c6

Browse files
committed
fix: don't include --from commit message in the output
1 parent 755f143 commit 23242c6

File tree

4 files changed

+8
-9
lines changed

4 files changed

+8
-9
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,16 @@ USAGE
6767
$ sf apex-tests-git-delta delta -f <value> -t <value> -e <value> --output <value> [--json]
6868
6969
FLAGS
70-
-f, --from=<value> Git commit SHA from where the commit message log is done. This SHA's commit message will be included in the results.
71-
-t, --to=<value> [default: HEAD] Git commit SHA to where the commit message log is done.
70+
-f, --from=<value> Commit SHA from where the commit message log is done. This SHA's commit message will not be included in the results.
71+
-t, --to=<value> [default: HEAD] Commit SHA to where the commit message log is done.
7272
-e, --regular-expression=<value> [default: regex.txt] The text file containing the Apex Tests regular expression to search for.
7373
--output=<value> [default: runTests.txt] The text file to save the delta test classes to.
7474
7575
GLOBAL FLAGS
7676
--json Format output as json.
7777
7878
DESCRIPTION
79-
Given 2 git commits, this plugin will parse all of the commit messages between this range, including the '--from' commit, and return the delta Apex test class string. This can be used to execute delta deployments.
79+
Given 2 git commits, this plugin will parse all of the commit messages between this range and return the delta Apex test class string. This can be used to execute delta deployments.
8080
8181
EXAMPLES
8282
$ sf apex-tests-git-delta delta --from "abcdef" --to "ghifb" --regular-expression "regex.txt" --output "runTests.txt"

messages/delta.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@ Returns all of the Apex Tests defined in the commit messages between 2 git commi
44

55
# description
66

7-
Given 2 git commits, this plugin will parse all of the commit messages between this range, including the '--from' commit, and return the delta Apex test class string. This can be used to execute delta deployments.
7+
Given 2 git commits, this plugin will parse all of the commit messages between this range and return the delta Apex test class string. This can be used to execute delta deployments.
88

99
# examples
1010

1111
- `sf apex-tests-git-delta delta --from "abcdef" --to "ghifb" --regular-expression "regex.txt" --output "runTests.txt"`
1212

1313
# flags.from.summary
1414

15-
Git commit SHA from where the commit message log is done.
15+
Commit SHA from where the commit message log is done. This SHA's commit message will not be included in the results.
1616

1717
# flags.to.summary
1818

19-
Git commit SHA to where the commit message log is done.
19+
Commit SHA to where the commit message log is done.
2020

2121
# flags.regular-expression.summary
2222

src/service/retrieveCommitMessages.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ import { execSync } from 'node:child_process';
33
import * as fs from 'node:fs';
44

55
export function retrieveCommitMessages(fromCommit: string, toCommit: string, regexFilePath: string): string[] {
6-
// ~1 to include the from commit SHA
7-
const gitLogCommand = `git log --format=%s ${fromCommit}~1..${toCommit}`;
6+
const gitLogCommand = `git log --format=%s ${fromCommit}..${toCommit}`;
87
let commitMessages: string;
98
try {
109
commitMessages = execSync(gitLogCommand, { encoding: 'utf-8' });

test/commands/delta/unit.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,6 @@ describe('return the delta tests between git commits', () => {
5757
.getCalls()
5858
.flatMap((c) => c.args)
5959
.join('\n');
60-
expect(output).to.include('SandboxTest TestClass00 TestClass3 TestClass4');
60+
expect(output).to.include('SandboxTest TestClass3 TestClass4');
6161
});
6262
});

0 commit comments

Comments
 (0)