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...).
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?
Thanks, Mat
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?
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.
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.
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
On 20 Jul 2007, at 13:45, Mat Schaffer wrote:
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.
Just to check – you know about Edit in TextMate, right? Bundles → TextMate → Install “Edit in TextMate”… With that installed you could simply ⌃⌘E tpl⇥
On Jul 20, 2007, at 8:55 AM, Ciarán Walsh wrote:
On 20 Jul 2007, at 13:45, Mat Schaffer wrote:
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.
Just to check – you know about Edit in TextMate, right? Bundles → TextMate → Install “Edit in TextMate”… With that installed you could simply ⌃⌘E tpl⇥
Ahhh... I sort of vaguely knew about that, but didn't know just where you could call it. Thanks, that definitely meets my "Survive an upgrade" requirement. Although, I still think it'd be cool to make the "Summary of changes" field just a small textmate window with Scope = text.subversion-commit.
Thanks, Mat
On 20. Jul 2007, at 15:06, Mat Schaffer wrote:
[...] Although, I still think it'd be cool to make the "Summary of changes" field just a small textmate window with Scope = text.subversion-commit.
I think we all agree on that, but it’ll have to wait till it’s actually possible ;)