[p4] Peforce History in source code

David Corbin dcorbin at csol.com
Thu Oct 21 11:28:08 PDT 1999


I think Marcs concept is a great idea, but the processing HAS to take place
on the server side, not the client.  I cannot guarantee that the client side
machine is configured properly.
----- Original Message -----
From: Marc Kwiatkowski <marc at hearme.com>
To: <perforce-user at perforce.com>
Sent: Wednesday, October 20, 1999 1:17 PM
Subject: RE: [p4] Peforce History in source code


>
> I couldn't agree more.  I'll put in one more plug for a generic
> post-submit, pre-sync hook.  Not only would this solve the $Foo$
> issue to everyone's satisfaction, it would also allow source code
> to be archived in some canonical form while allowing each developer
> to specify whatever indentation style she likes.  No more arguments
> about tabs or spaces, 2, 4, or 8 space indents, curly brace on
same/different
> line.
>
> What I have in mind is that the administrator specify in the main database
> standard hooks to be run.  This could be done using a similar syntax as
> the client view specification, for example:
>
>
> # depot sync-hook submit-hook
> file://depot/foo/%.c p4toc ctop4
> file://depot/foo/%.h p4toc ctop4
> file://depot/foo/%.cpp p4toc ctop4
> file://depot/foo/%.java p4tojava javatop4
>
> Where p4toc is some script or program that formats canonical C source
> (ie packed, no extra white space, no extra newlines) into the
organizations
> standard C format.  ctop4 does the inverse; removes all extraneouse
whitespace,
> newlines, tabs.  Ditto for java.
>
> In addition developers could specify their own hooks, possibly in their
> user or client view specifications
>
> file://depot/foo/%.c myp4toc myctop4
>
> An additional token could be used to specify whether the user's
> hooks should be run before, after, or instead of the default hook.  For
> example:
>
> # - run hook before
> # + run hook after
>
> # depot sync-hook submit-hook
> # override standard hooks for C
> file://depot/foo/%.c myp4toc myctop4
> file://depot/foo/%.h myp4toc myctop4
>
> # run C++ hook after default hook
> file://depot/foo/%.cpp +myp4tocpp -mycpptop4
>
> # run javae hook before default hook
> file://depot/foo/%.java -myp4tojava +myjavatop4
>
> Obviously such hook-processing involves a bit of work, but the work can
all
> be done on the client side where it should be.
>
> It could potentially make resolution a little tricky, since you resolve
canonical conflicts.
> This could be solved it the temporary files generated by p4-resolve use
the
> same hooks.
>
> It's my belief that storing source-code in canonical format would
eliminate
> a big chunk of conflicts, namely spurious white-space changes.  I also
think
> it would make for better coding standards.  If you can't express your
> coding standard in a perl or python script, it's not a good standard to
> begin with.
>
> Also note that noone has to use hooks at all, and that would in fact be
> the default behavior.
>
> Anthony Kolarik writes:
>  >
>  >
>  >
>  > In 10 years of working with files that had $Log$ I found it useful
maybe 3
>  > times, and then only to the extent that I didn't have to issue a
command to find
>  > the same comment.  Mostly it was just a royal pain doing diffs and
merges, and
>  > paging through more useless lines of aged comments at either the top or
bottom
>  > of files than there were actual lines of code.  And from the sound of
it I'm not
>  > alone in this view of $Log$'s alleged utility.
>  >
>  > Perforce, please don't do this just because you can.  If users want it
that bad,
>  > a user solution can be written and hopefully posted in a public place,
like all
>  > the other nice auxiliary programs on your site.  If you _do_ run out of
other
>  > things to do, you might want to look back a few months in the archive
of this
>  > list and think about the idea someone had of implementing a mini
language for
>  > inline keyword expansions... why stop at $Foo$?  And then please make
it an easy
>  > feature to disable at the server.
>  >
>  >
>  >
>  > _______________________________________________
>  > perforce-user mailing list  -  perforce-user at perforce.com
>  > http://maillist.perforce.com/mailman/listinfo/perforce-user
>
> --
> marc at hearme.com
>
>
> _______________________________________________
> perforce-user mailing list  -  perforce-user at perforce.com
> http://maillist.perforce.com/mailman/listinfo/perforce-user
>
>





More information about the perforce-user mailing list