Bug 38047 - svn-apply: suppress misleading "error: pathspec ..." message when adding binary file
Summary: svn-apply: suppress misleading "error: pathspec ..." message when adding bina...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Chris Jerdonek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-23 09:26 PDT by Chris Jerdonek
Modified: 2010-05-08 19:39 PDT (History)
3 users (show)

See Also:


Attachments
Proposed patch (3.30 KB, patch)
2010-05-08 08:12 PDT, Chris Jerdonek
cjerdonek: commit-queue-
Details | Formatted Diff | Diff
Proposed patch (4.05 KB, patch)
2010-05-08 08:18 PDT, Chris Jerdonek
cjerdonek: commit-queue-
Details | Formatted Diff | Diff
Proposed patch 3 (4.05 KB, patch)
2010-05-08 08:21 PDT, Chris Jerdonek
dbates: review+
cjerdonek: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Jerdonek 2010-04-23 09:26:20 PDT
See here for an example of the misleading "error: pathspec" message:

https://bugs.webkit.org/show_bug.cgi?id=37044#c12

To solve this, console output should be suppressed in this method of svn-apply:

sub scmKnowsOfFile($)
{
    my ($path) = @_;
    if (isSVN()) {
    ...
    } elsif (isGit()) {
        `git ls-files --error-unmatch -- $path`; <-- Suppress console output.
        my $exitCode = $? >> 8;
        return $exitCode == 0;
    }
}
Comment 1 Chris Jerdonek 2010-05-08 08:12:28 PDT
Created attachment 55475 [details]
Proposed patch
Comment 2 Chris Jerdonek 2010-05-08 08:18:46 PDT
Created attachment 55476 [details]
Proposed patch

Corrected ChangeLog.
Comment 3 Chris Jerdonek 2010-05-08 08:21:46 PDT
Created attachment 55477 [details]
Proposed patch 3

Fixed a code comment: STDOUT -> STDERR.
Comment 4 Daniel Bates 2010-05-08 18:19:06 PDT
Comment on attachment 55477 [details]
Proposed patch 3

We should add a comment to reference the Perldocs about this.

> +sub callSilently($@) {
> +    my ($func, @args) = @_;
> +
> +    open(OLDERR, ">&STDERR");
> +    close(STDERR);
> +    my @returnValue = &$func(@args);
> +    open(STDERR, ">&OLDERR");
> +    close(OLDERR); # FIXME: Is this necessary?
> +
> +    return @returnValue;
> +}
> +

We should probably change this to use exitStatus. We can do this in another patch, but then we should add a FIXME comment.

> +sub gitKnowsOfFile($)
> +{
> +    my $path = shift;
> +
> +    `git ls-files --error-unmatch -- $path`;
> +    my $exitCode = $? >> 8;
> +    return $exitCode == 0;
> +}

r=me.
Comment 5 Chris Jerdonek 2010-05-08 19:39:14 PDT
Committed:

http://trac.webkit.org/changeset/59043