You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Pierre Lemay <le...@videotron.ca> on 2007/08/21 13:58:42 UTC

Triming file content before it get commited?

Hello everyone,

 We are facing a little environment problem, which is not due to SVN, 
but I was wandering if SVN could be used to resolve the problem we are 
facing.  Basically, we have some kind of source files that some editors 
used by developpers will automatically pad each lines to 80 characters 
(blank), while other developpers use some editors that will not do such 
padding.   This lead to a situation where if a source code is created by 
someone using a non-padding editor and save the file to SVN, and then 
someone using the other kind of editor attempts to modify a single line 
of the same file and submit the change to SVN, each single line of the 
file will show up as modified, i.e. all lines will be padded with blank 
characters....

  Anyone knows if a hook could be used to "trim" files with a 
pre-determined file extension before they are actually committed in 
SVN?  Any suggestion on how we could configure the SVN server to help 
resolve the situation?  The SVN server is running on unix, while the 
clients environment could be either Unix or windows.

  Looking at the SVN documentation about hook, I doubt this could be 
what hooks are intended for, but in case I might be missing something,  
I would like the feed back of  more experienced SVN users.

 Thanks,

Pierre

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Triming file content before it get commited?

Posted by Talden <ta...@gmail.com>.
There is no provided client-side pre-commit hook facility (though the
idea poses interesting possibilities). As far as I am aware there are
no support tools that provide this either.

You could write client-side scripts to do this yourself - any number
of scripting languages or shell-script languages will provide the
means to do so - you need to invoke them yourself prior to committing
though.

As far as enforcing a repository policy goes though, you have much
better support - the pre-commit server-side hook would allow you to
peek at the transaction content and validate it's compliance to your
policy.  You can then reject non-complying commits, you cannot correct
them server-side however.

--
Talden

On 8/22/07, Pierre Lemay <le...@videotron.ca> wrote:
> Hello everyone,
>
>  We are facing a little environment problem, which is not due to SVN,
> but I was wandering if SVN could be used to resolve the problem we are
> facing.  Basically, we have some kind of source files that some editors
> used by developpers will automatically pad each lines to 80 characters
> (blank), while other developpers use some editors that will not do such
> padding.   This lead to a situation where if a source code is created by
> someone using a non-padding editor and save the file to SVN, and then
> someone using the other kind of editor attempts to modify a single line
> of the same file and submit the change to SVN, each single line of the
> file will show up as modified, i.e. all lines will be padded with blank
> characters....
>
>   Anyone knows if a hook could be used to "trim" files with a
> pre-determined file extension before they are actually committed in
> SVN?  Any suggestion on how we could configure the SVN server to help
> resolve the situation?  The SVN server is running on unix, while the
> clients environment could be either Unix or windows.
>
>   Looking at the SVN documentation about hook, I doubt this could be
> what hooks are intended for, but in case I might be missing something,
> I would like the feed back of  more experienced SVN users.
>
>  Thanks,
>
> Pierre
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: users-help@subversion.tigris.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Triming file content before it get commited?

Posted by Erik Huelsmann <eh...@gmail.com>.
On 8/21/07, Pierre Lemay <le...@videotron.ca> wrote:
> Hello everyone,
>
>  We are facing a little environment problem, which is not due to SVN,
> but I was wandering if SVN could be used to resolve the problem we are
> facing.  Basically, we have some kind of source files that some editors
> used by developpers will automatically pad each lines to 80 characters
> (blank), while other developpers use some editors that will not do such
> padding.   This lead to a situation where if a source code is created by
> someone using a non-padding editor and save the file to SVN, and then
> someone using the other kind of editor attempts to modify a single line
> of the same file and submit the change to SVN, each single line of the
> file will show up as modified, i.e. all lines will be padded with blank
> characters....

Subversion has support for ignoring space change starting 1.4. It can
be used with blame, merge and diff. (Now that I'm writing this I start
wondering if not - and why not - update).

HTH,

Erik.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org