[p4] p4 submit w/o an editor

Weintraub, David david.weintraub at bofasecurities.com
Fri Jul 14 07:26:26 PDT 2006

Yes, I know that you can use a pipe. Yes, you also don't have to provide
all of the fields in a form. Still, which is easier to understand and
probably maintain? Which is easier to enter on a command line?

   $ printf 'Client: drj-temp\nRoot: /tmp/drj-temp\nView:
//info.ravenbrook.com/foo-bar/... //drj-temp/...' | p4 client -i


  $ p4 client -client "drj-temp" -root "/tmp/drj-temp" -view
"//info.ravenbrook.com/foo-bar/... //drj-temp/..."

There is an argument that there is a greater cost for Perforce to
implement these command line parameters, document them, and support
them. That it takes away time and effort in Perforce's ability to
provide support in other areas. Since there are workarounds to these
issues, Perforce really shouldn't bother with it.

However, there is also time and effort involved in local maintenance in
implementing "workarounds". The first system I programmed on was an
amazing little box called Cado. Back in the late 1970s and early 1980s,
other business computers of compatible ability were in the 100K range,
but you could buy a Cado for under 30k.

The secret was a simplified architecture: Only 48K of memory running on
a 8085A processor, it could support up to 4 users. However, there was a
cost. To keep the hardware simple, everything else was quite complex.
The programming language, Cadol, had only 26 six byte numeric registers,
9 alpha registers of various lengths (40 and 20 characters long), and
five 255 byte buffers. Programming was done in 255 byte segments, and
all resources were shared in the program. There wasn't even a real file
system. We kept track of where we placed files on a piece of paper. It
was very easy to accidentally overlap files, or even overlap files and
programs. The savings of hardware greatly increased the development and
maintenance of the software.

Cado actually did a pretty good business for a while, but when general
hardware costs started to drop, the complexity of maintaining a Cado box
started interfering with its ability to compete. In a sense, Cado bet
that local human resource costs would always be cheaper than the
hardware costs. When Cado lost that bet, they lost their business.

Yes, in one sense, it is cheaper for Perforce to keep its programs
fairly simple, and have its users work around the limitations. However,
in reality, it only pushes the cost of Perforce a bit farther down the
road. Bugs in scripts and triggers means more support that Perforce
technical support must maintain. It takes longer to bring a new Perforce
administrator up to speed as they must learn the various means to get
around the limitations. Developers spend a lot more time writing and
maintaining triggers. More errors happen, more damage control needs to
take place. All of this drives up the costs. It's all a balancing act.
Make your programs more complex can save local maintenance problems, but
makes design and testing much harder. Simplifying the program saves
testing and programming time, but adds to local maintenance costs.

Expanding the ability of programs to use more command line parameters
that are already used by the program is not a very costly endeavor.
Changing the exit codes to non-zero of a program that already outputs to
STDERR and dies when something unexpected happens is not too complex.
However, these two minor changes would make Perforce a lot easier to use
and will lower local maintenance costs and reduce errors.

-----Original Message-----
From: David Jones [mailto:drj at ravenbrook.com] 
Sent: Friday, July 14, 2006 4:12 AM
To: Weintraub, David
Cc: 'perforce-user at perforce.com'
Subject: Re: [p4] p4 submit w/o an editor

On 13 Jul 2006, at 21:32, Weintraub, David wrote:

>     $ p4 client -client "temp$$" -root "$PWD" -view "//depot/dir/ 
> dir/...
> //temp$$/..."
>     $ p4 -c "temp$$" sync
>     $ p4 client -d "temp$$"
> Takes all of three lines. Instead, I have to build a form in a text 
> file, then redirect that input back into the "p4 client" command. A 
> much messier process.

You don't need a file, a pipe will do:

printf 'Client: drj-temp\nRoot: /tmp/\nView: //info.ravenbrook.com/
foo-bar/... //drj-temp/...' | p4 client -i

You might be surprised at how minimal a form you can get away with:

printf 'Change: new\nDescription: spong' | p4 change -i

Nonetheless I also think command line options for form values would be a
good idea.

David Jones
Ravenbrook Limited

More information about the perforce-user mailing list