[TxMt] SVN log templates

Mat Schaffer schapht at gmail.com
Fri Jul 20 12:45:29 UTC 2007


On Jul 20, 2007, at 8:16 AM, Allan Odgaard wrote:
> On 18. Jul 2007, at 22:04, Mat Schaffer wrote:
>> Is there a "right way" to allow for SVN log templates?  Basically  
>> I'd like to be able to easily populate the comments section of the  
>> CommitWindow with a template (or snippet, or...).
> By “comments section” do you mean the “Summary of changes” text field?

Yes, sorry, didn't watch for the terminology.

>> The best I've found so far is adding:
>>
>> @commit_args.gsub!("-m ''", '')
>>
>> to /Applications/TextMate.app/Contents/SharedSupport/Bundles/ 
>> Subversion.tmbundle/Support/svn_commit.rb
>>
>> Which causes the svn's client behavior to kick in and spawn EDITOR  
>> (mate -w) to write comments.  Is this as good as it gets?
>
> There isn’t any support for what I think you’re asking -- but it  
> can probably be added.

That'd be awesome.  Turning that "Summary changes field" into a mini  
textmate would be pretty cool.

> Likely your problem with the EDITOR stuff comes from treating the  
> result incorrectly (not handling proper escaping etc.).
>
> If ‘res’ is the result from calling CommitWindow.app then you can do:
>
>     res   = Shellwords.shellwords(res)
>     msg   = res[1]
>     files = res[2..-1]
>
> Now ‘msg’ is the commit message and ‘files’ is an array of the  
> files to commit. But when calling svn, you’ll need to use e_sh for  
> ‘msg’ and each file.
>
> If you need further help, please be more specific of what your end  
> goal here is.

The EDITOR solution works, I just don't like having to hack the  
TextMate bundle for fear that I'll loose my changes on the next  
upgrade.  Shellwords would probably be better (although I haven't hit  
any escaping issues yet).  But it still seems like I'd loose it on an  
upgrade.

At a high level, I'm trying to give our developers an easy way to use  
textmate to do svn commits with our company-mandated log template.   
Snippets seem like a good way to accomplish this.  We have a few  
developers who work in textmate, so it'd be best if the solution was  
permanent and easily repeatable across workstations.

Thanks!
-Mat




More information about the textmate mailing list