[
https://issues.apache.org/jira/browse/SCM-246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17963031#comment-17963031
]
ASF GitHub Bot commented on SCM-246:
------------------------------------
jira-importer commented on issue #992:
URL: https://github.com/apache/maven-scm/issues/992#issuecomment-2964637989
**[Mike
Perham](https://issues.apache.org/jira/secure/ViewProfile.jspa?name=mperham)**
commented
The Perforce provider is terrible wrt code sharing and reuse, mostly due to
limitations in the SCM API. There is no AbstractPerforceCommand because each
type of command has its own base class (!). So you get crappy, static
method-based code sharing and no one is happy, especially me. So adding "TODO
Share more code" isn't terribly helpful. Actual suggestions on how to improve
the code would be much appreciated (and patches even more so!).
> p4 command reports most or all errors on stderr but
> maven-scm-provider-perforce throws away stderr
> --------------------------------------------------------------------------------------------------
>
> Key: SCM-246
> URL: https://issues.apache.org/jira/browse/SCM-246
> Project: Maven SCM (Moved to GitHub Issues)
> Issue Type: Bug
> Components: maven-scm-provider-perforce
> Environment: I tested this with whatever version came down by default
> & then with the lastest svn trunk. The fixes & affects versions available in
> this issue form don't seem to match the versions available.
> [tomp@tua maven-scm-provider-perforce]$ p4 -V
> Perforce - The Fast Software Configuration Management System.
> Copyright 1995-2006 Perforce Software. All rights reserved.
> Rev. P4/LINUX24X86/2006.1/101890 (2006/06/21).
> [tomp@tua maven-scm-provider-perforce]$ p4 info
> User name: tparker
> Client name: tua
> Client host: tua.uiactive.com
> Client unknown.
> Current directory:
> /u01/tomp/maven-scm/maven-scm-providers/maven-scm-provider-perforce
> Client address: 172.18.1.29:52715
> Server address: sydb.bullant.local:1666
> Server root: P:\P4ROOT
> Server date: 2006/10/31 16:47:50 +1100 AUS Eastern Daylight Time
> Server version: P4D/NTX86/2005.2/93627 (2006/02/14)
> Server license: Bullant Software (fka Bullant Technology - fna Softblocks
> Pty.) 40 users (support expired 2006/10/04)
> Reporter: Tom Parker
> Assignee: Siveton Vincent
> Priority: Major
> Fix For: 1.2
>
> Attachments: maven-scm-provider-perforce.patch, scm-246.patch
>
>
> This applies to most or all commands in maven-scm-provider-perforce. I was
> unable to fix some basic scm configuration issues until I downloaded the
> maven-scm-provider-perforce source and hacked it to consume and report the p4
> command's stderr as well as stdout.
> The attached patch fixes the problem for diff, checkin, checkout and tag. My
> solution naively consumes stdout until it is finished and then consums
> stderr. This isn't ideal if the output order is significant, but for the
> errors situations I was dealing with, it worked fine. I had a brief search
> for an InputStreamMultiplexer but found nothing. I have included todos to
> improve this.
> There is much potential for reuse between the classes in
> maven-scm-provider-perforce, I have included todo's stating as such.
> I have not fixed all the perforce commands. Sorry.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)