You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Jay Levitt <li...@shopwatch.org> on 2007/08/30 21:00:42 UTC

svn:template (ignore local changes)?

Occasionally the question pops up from people who want to make local 
changes to a template-type file and don't want them to be committed. 
You can't put such a file into svn:ignore, because it does (and should) 
exist in the repository; it just shouldn't be recommitted once it's changed.

The FAQ states to rename the file to .tmpl or similar, and have 
developers copy the file to its actual filename upon editing.  That 
works, but it's clunky, and requires everyone to take manual steps to 
use that file, even if they don't plan to edit it.  It also causes 
particular issues for systems like Capistrano in Rails, which checks out 
a copy of the repository and expects it to be deployable as-is.

I'm sure it can all be worked around with commit hooks and checkout 
hooks (are there checkout hooks?) and scripting and such, but an 
svn:template parameter SEEMS, at first blush, to be a fairly 
non-controversial feature that just hasn't made it onto anyone's list.

Would a patch be likely to be accepted for such a feature?  Is there 
some big usage gotcha that I'm missing?  I'd love to have this and it 
seems like it should be relatively easy to code.  It'd basically be 
identical to the svn:ignore functionality, except that svn up/co/export 
would have to get the file anyway (though I'm not sure they look at 
svn:ignore today, since you can't have svn:ignore on an existing file), 
and svn commit would have to be able to check in changes to the template 
somehow (--force-changed-template or a better name).  Anything else?

Jay Levitt

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

Re: svn:template (ignore local changes)?

Posted by "C. Michael Pilato" <cm...@collab.net>.
Jay Levitt wrote:
>> So, if I've got this right, you add the svn:template property after
>> creating the template, adding it, and committing it to the
>> repository.  However, if you want to modify the template, you remove
>> the property, commit its removal (requiring a special hack to detect
>> this case?), make your changes + restore the prop, and commit again.
>>
>> This makes the editing process awfully clunky...
> 
> 
> Nonono, that would indeed be horrible.
> 
> I'm envisioning this behaviour:
> 
> - At some point after adding a file, somebody adds property
> "svn:template" to the file.
> - blame, cat, cleanup, copy, delete, info, list, lock, log, merge,
> prop*, resolved, revert, unlock are unaffected by svn:template.
> - status and update ignore the file, as if it were in its parent's
> svn:ignore property.
> - diff ignores the file if you are diffing its directory, but displays
> the changes if you are diffing it directly.
> - commit will, by default, ignore the file.
> - If you pass --commit-updated-template to commit, it will check your
> local changes in.
> 
> How's that sound?

Have you seen http://subversion.tigris.org/issues/show_bug.cgi?id=2858 ?

-- 
C. Michael Pilato <cm...@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand


Re: svn:template (ignore local changes)?

Posted by Jay Levitt <li...@shopwatch.org>.
Daniel Rall wrote:
> 
> On Aug 30, 2007, at 2:00 PM, Jay Levitt wrote:
> 
>> Occasionally the question pops up from people who want to make local 
>> changes to a template-type file and don't want them to be committed. 
>> You can't put such a file into svn:ignore, because it does (and 
>> should) exist in the repository; it just shouldn't be recommitted once 
>> it's changed.
> 
> This is indeed a common use case.
> 
>> The FAQ states to rename the file to .tmpl or similar, and have 
>> developers copy the file to its actual filename upon editing.  That 
>> works, but it's clunky, and requires everyone to take manual steps to 
>> use that file, even if they don't plan to edit it.  It also causes 
>> particular issues for systems like Capistrano in Rails, which checks 
>> out a copy of the repository and expects it to be deployable as-is.
>>
>> I'm sure it can all be worked around with commit hooks and checkout 
>> hooks (are there checkout hooks?) and scripting and such, but an 
>> svn:template parameter SEEMS, at first blush, to be a fairly 
>> non-controversial feature that just hasn't made it onto anyone's list.
> 
> So, if I've got this right, you add the svn:template property after 
> creating the template, adding it, and committing it to the repository.  
> However, if you want to modify the template, you remove the property, 
> commit its removal (requiring a special hack to detect this case?), make 
> your changes + restore the prop, and commit again.
> 
> This makes the editing process awfully clunky...


Nonono, that would indeed be horrible.

I'm envisioning this behaviour:

- At some point after adding a file, somebody adds property
"svn:template" to the file.
- blame, cat, cleanup, copy, delete, info, list, lock, log, merge, 
prop*, resolved, revert, unlock are unaffected by svn:template.
- status and update ignore the file, as if it were in its parent's 
svn:ignore property.
- diff ignores the file if you are diffing its directory, but displays 
the changes if you are diffing it directly.
- commit will, by default, ignore the file.
- If you pass --commit-updated-template to commit, it will check your 
local changes in.

How's that sound?

> 
>> Would a patch be likely to be accepted for such a feature?  Is there 
>> some big usage gotcha that I'm missing?  I'd love to have this and it 
>> seems like it should be relatively easy to code.  It'd basically be 
>> identical to the svn:ignore functionality, except that svn 
>> up/co/export would have to get the file anyway (though I'm not sure 
>> they look at svn:ignore today, since you can't have svn:ignore on an 
>> existing file), and svn commit would have to be able to check in 
>> changes to the template somehow (--force-changed-template or a better 
>> name).  Anything else?
> 

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

Re: svn:template (ignore local changes)?

Posted by Daniel Rall <dl...@finemaltcoding.com>.
On Aug 30, 2007, at 2:00 PM, Jay Levitt wrote:

> Occasionally the question pops up from people who want to make  
> local changes to a template-type file and don't want them to be  
> committed. You can't put such a file into svn:ignore, because it  
> does (and should) exist in the repository; it just shouldn't be  
> recommitted once it's changed.

This is indeed a common use case.

> The FAQ states to rename the file to .tmpl or similar, and have  
> developers copy the file to its actual filename upon editing.  That  
> works, but it's clunky, and requires everyone to take manual steps  
> to use that file, even if they don't plan to edit it.  It also  
> causes particular issues for systems like Capistrano in Rails,  
> which checks out a copy of the repository and expects it to be  
> deployable as-is.
>
> I'm sure it can all be worked around with commit hooks and checkout  
> hooks (are there checkout hooks?) and scripting and such, but an  
> svn:template parameter SEEMS, at first blush, to be a fairly non- 
> controversial feature that just hasn't made it onto anyone's list.

So, if I've got this right, you add the svn:template property after  
creating the template, adding it, and committing it to the  
repository.  However, if you want to modify the template, you remove  
the property, commit its removal (requiring a special hack to detect  
this case?), make your changes + restore the prop, and commit again.

This makes the editing process awfully clunky...

> Would a patch be likely to be accepted for such a feature?  Is  
> there some big usage gotcha that I'm missing?  I'd love to have  
> this and it seems like it should be relatively easy to code.  It'd  
> basically be identical to the svn:ignore functionality, except that  
> svn up/co/export would have to get the file anyway (though I'm not  
> sure they look at svn:ignore today, since you can't have svn:ignore  
> on an existing file), and svn commit would have to be able to check  
> in changes to the template somehow (--force-changed-template or a  
> better name).  Anything else?

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