Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly strip quotes in GitStatusConsumer #26

Merged
merged 2 commits into from
Apr 6, 2016

Conversation

sralmai
Copy link
Contributor

@sralmai sralmai commented Jan 2, 2015

Before this, GitStatusConsumer.resolvePath() and
GitStatusConsumer.resolveURI() got into trouble with
files that include spaces.

To reproduce failure condition (in a git repo):

echo "I'll fail" > "some nice file"
git add "some nice file"
git status --porcelain

The output of the git status is:

A  "some nice file"

This causes at least
JENKINS-24686
downstream.

Before this, `GitStatusConsumer.resolvePath()` and
`GitStatusConsumer.resolveURI()` got into trouble with
files that include spaces.

To reproduce failure condition (in a git repo):

    echo "I'll fail" > "some nice file"
    git add "some nice file"
    git status --porcelain

The output of the `git status` is:

    A  "some nice file"

This causes at least
[JENKINS-24686](https://issues.jenkins-ci.org/browse/JENKINS-24686)
downstream.
@ghost
Copy link

ghost commented Jan 6, 2015

This is very useful.

tomaswolf added a commit to tomaswolf/scm-sync-configuration-plugin that referenced this pull request Jul 6, 2015
The basic problem here is SCM-772.[1] maven-scm cannot parse the output
from git status if it contains quoted/escaped file names.

There's at least two pull requests, one attached to SCM-772 and one at
[2] aimed at fixing this; both are erroneous and don't look like they'd
go in anytime soon. (The first one would at least replace \r by \f, and
the second one only strips quotes but doesn't de-escape.)

So we fix this by providing our own commands in our own gitexe
provider and making sure that our implementation of these commands can
deal with quoted/escaped filenames.

Enabled the two test cases for job names with blanks.

Also, since we're rewriting part of maven-scm here anyway, I've also
included a minimal and proper fix for SCM-695.[3]

[1] https://issues.apache.org/jira/browse/SCM-772
[2] apache/maven-scm#26
[3] https://issues.apache.org/jira/browse/SCM-695
rodrigc pushed a commit to jenkinsci/scm-sync-configuration-plugin that referenced this pull request Dec 12, 2015
The basic problem here is SCM-772.[1] maven-scm cannot parse the output
from git status if it contains quoted/escaped file names.

There's at least two pull requests, one attached to SCM-772 and one at
[2] aimed at fixing this; both are erroneous and don't look like they'd
go in anytime soon. (The first one would at least replace \r by \f, and
the second one only strips quotes but doesn't de-escape.)

So we fix this by providing our own commands in our own gitexe
provider and making sure that our implementation of these commands can
deal with quoted/escaped filenames.

Enabled the two test cases for job names with blanks.

Also, since we're rewriting part of maven-scm here anyway, I've also
included a minimal and proper fix for SCM-695.[3]

[1] https://issues.apache.org/jira/browse/SCM-772
[2] apache/maven-scm#26
[3] https://issues.apache.org/jira/browse/SCM-695
olamy added a commit to olamy/maven-scm that referenced this pull request Apr 6, 2016
[SCM-820] Correctly strip quotes in GitStatusConsumer
fixes apache#26
@asfgit asfgit merged commit 9080d85 into apache:master Apr 6, 2016
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