apache / apache/maven-scm

[SCM-952] check-local-modification does not recognize new files (git)

Open
#1,170 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
104
Forks
189
Avg merge
17h 46m
Merged PRs (30d)
6

Description

**[D T](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=st-ddt)** opened **[SCM-952](https://issues.apache.org/jira/browse/SCM-952?redirect=false)** and commented

If I add a new file src/main/MyNewFile.txt to my project and run

mvn scm:check-local-modification

 
then the build completes successfully, showing only a warning regarding an unrecognized lines:

```java
[INFO] Scanning for projects...
[INFO]
[INFO] --------------< test:test >--------------
[INFO] Building Test 1.9.1-SNAPSHOT
[INFO] ----------------------------[ maven-plugin ]----------------------------
[INFO]
[INFO] --- maven-scm-plugin:1.11.2:check-local-modification (default-cli) @ test ---
[INFO] Executing: cmd.exe /X /C "git rev-parse --show-prefix"
[INFO] Working directory: C:\Users\test\git\test
[INFO] Executing: cmd.exe /X /C "git status --porcelain ."
[INFO] Working directory: C:\Users\test\git\test
[WARNING] Ignoring unrecognized line: ?? src/main/MyNewFile.txt
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.247 s
[INFO] Finished at: 2021-07-15T11:39:32+02:00
[INFO] ------------------------------------------------------------------------
```

**Expected result:**
Build failed, because there is a file that isn't ignored or commited.

```java
$ git --version
git version 2.32.0.windows.2
```

---

**Affects:** 1.11.2

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the issue with the check-local-modification goal and the shown git status --porcelain output containing an untracked file. Trace the Git handling that parses this output and determine how unrecognized lines are treated. Done means an unignored, uncommitted new file causes the Maven build to fail while ignored files remain unaffected.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, java
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.