Skip to content

Conversation

@cx-rui-oliveira
Copy link
Contributor

Proposed Changes

This PR adds a new --base-commit flag to the Git plugin that allows users to scan only commits between a specified base commit and HEAD.

Key changes:

  • Added --base-commit string flag to the Git plugin command
  • Modified buildScanOptions() method to use Git range syntax (BASE_COMMIT..HEAD) when base commit is specified
  • Base commit takes precedence over the --depth flag when both are provided
  • Updated README.md documentation to include the new flag

Use case example:

# Scan commits between a specific commit and HEAD
2ms git /path/to/repo --base-commit abc123

This implements the Git log functionality equivalent to git log BASE_COMMIT..HEAD -p -U0.

Checklist

  • I covered my changes with tests.
  • I Updated the documentation that is affected by my changes:
    • Change in the CLI arguments
    • Change in the configuration file

I submit this contribution under the Apache-2.0 license.

@cx-rui-oliveira cx-rui-oliveira requested a review from a team as a code owner July 2, 2025 10:38
@github-actions
Copy link

github-actions bot commented Jul 2, 2025

kics-logo

KICS version: v1.7.13

Category Results
HIGH HIGH 0
MEDIUM MEDIUM 0
LOW LOW 0
INFO INFO 0
TRACE TRACE 0
TOTAL TOTAL 0
Metric Values
Files scanned placeholder 12
Files parsed placeholder 12
Files failed to scan placeholder 0
Total executed queries placeholder 53
Queries failed to execute placeholder 0
Execution time placeholder 1

@github-actions
Copy link

github-actions bot commented Jul 2, 2025

Logo
Checkmarx One – Scan Summary & Details780ca5bc-9c23-41bb-b902-c6e3cab427f4

Great job, no security vulnerabilities found in this Pull Request

@cx-rui-oliveira cx-rui-oliveira merged commit 34b3904 into master Jul 4, 2025
12 checks passed
@cx-rui-oliveira cx-rui-oliveira deleted the AST-93068-backend-2-ms-run-incremental-scans-when-last-scanned-commit-is-an-ancestor branch July 4, 2025 17:19
cx-rogerio-dalot pushed a commit that referenced this pull request Sep 11, 2025
**Proposed Changes**

This PR adds a new `--base-commit` flag to the Git plugin that allows
users to scan only commits between a specified base commit and HEAD.

**Key changes:**
- Added `--base-commit` string flag to the Git plugin command
- Modified `buildScanOptions()` method to use Git range syntax
(`BASE_COMMIT..HEAD`) when base commit is specified
- Base commit takes precedence over the `--depth` flag when both are
provided
- Updated README.md documentation to include the new flag

**Use case example:**
```bash
# Scan commits between a specific commit and HEAD
2ms git /path/to/repo --base-commit abc123
```

This implements the Git log functionality equivalent to `git log
BASE_COMMIT..HEAD -p -U0`.

**Checklist**

- [x] I covered my changes with tests.
- [x] I Updated the documentation that is affected by my changes:
  - [x] Change in the CLI arguments
  - [ ] Change in the configuration file

I submit this contribution under the Apache-2.0 license.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants