apache / apache/maven-scm

[SCM-971] GitExe - unstaged local changes overlooked in release:prepare check

Open
#1,196 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

**[Ben Arnold](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=bamoh)** opened **[SCM-971](https://issues.apache.org/jira/browse/SCM-971?redirect=false)** and commented

The `release:prepare` goal checks for local modifications and is supposed to fail if it finds any.

The GitExe provider is responsible for identifying local modifications. It detects staged local modifications as expected but it can't parse the status code that indicates a file has local modifications that are unstaged.

Unstaged changes show up in the output of `git status --porcelain` tagged with a pair of question marks (`??`). GitStatusConsumer doesn't understand these output lines and logs them as warnings, but that doesn't cause `release:prepare` to fail.

It looks like GitStatusConsumer needs to be enhanced so that it can parse unstaged lines in the `git status --porcelain` output. These unstaged messages need to be returned to ScmCheckModificationsPhase so that it can fail correctly.

Note that two of these unstaged files are likely to be `release.properties` and `pom.xml.releaseBackup`. These are created by the release plugin itself and shouldn't cause the release preparation to fail.

---

**Affects:** 1.12.0

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating GitStatusConsumer and ScmCheckModificationsPhase, then inspect how `git status --porcelain` output is parsed and returned. Reproduce output containing `??` entries; done means genuine unstaged changes make `release:prepare` fail while release.properties and pom.xml.releaseBackup do not.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.