Is there a way to run some code from a Bundle before TextMate opens a file? The idea would be that when I run either:
$ mate foo.c
or
$ mate myprojectdir
and then click on foo.c I get to see if foo.c is version controlled and then I check it out if it is. The version control system that I use (BitKeeper) has a 'get' mode that checks out the files read-only, and before editing you have to check them out in 'edit' mode. I have written a function in a bundle that does this, but I have to call it manually. I would like that to be automatic...
Thanks,
-Oscar
-- pgp fingerprint: BC64 2E7A CAEF 39E1 9544 80CA F7D5 784D FB46 16C1
On Feb 10, 2006, at 10:23 AM, Oscar Bonilla wrote:
and then click on foo.c I get to see if foo.c is version controlled and then I check it out if it is. The version control system that I use (BitKeeper) has a 'get' mode that checks out the files read- only, and before editing you have to check them out in 'edit' mode. I have written a function in a bundle that does this, but I have to call it manually. I would like that to be automatic...
Sounds like perforce. I would really NOT like that sort of automatic behavior with perforce but I've never used BitKeeper so I don't know if the same issues apply.
I WOULD like TextMate to warn if you try to edit a read-only file, and if that could be hooked to perform an action, like a version control operation. It could be a sheet something like:
ALERT! You just tried to change a file opened as read-only.
{ Make Writable } { Cancel }
And if bundles had registered hooks, you might get some options in the sheet like:
Perforce -> Checkout for edit BitKeeper -> Checkout for edit
-john
On Feb 10, 2006, at 10:59 AM, John Fieber wrote:
Sounds like perforce. I would really NOT like that sort of automatic behavior with perforce but I've never used BitKeeper so I don't know if the same issues apply.
I'm curious... what are the issues you talk about?
-Oscar
-- pgp fingerprint: BC64 2E7A CAEF 39E1 9544 80CA F7D5 784D FB46 16C1
On Feb 10, 2006, at 11:50 AM, Oscar Bonilla wrote:
On Feb 10, 2006, at 10:59 AM, John Fieber wrote:
Sounds like perforce. I would really NOT like that sort of automatic behavior with perforce but I've never used BitKeeper so I don't know if the same issues apply.
I'm curious... what are the issues you talk about?
PMFJI... Probably the issue is copy-modify-merge vs. lock-modify-unlock:
http://svnbook.red-bean.com/en/1.1/ch02s02.html
But I don't see how the Perforce vs. BitKeeper vs. whatever wars are relevant. Can't the TextMate user choose whatever versioning control system works best for him?
Trevor
On Feb 10, 2006, at 12:16 PM, Trevor Harmon wrote:
But I don't see how the Perforce vs. BitKeeper vs. whatever wars are relevant. Can't the TextMate user choose whatever versioning control system works best for him?
The wars are not relevant to the discussion. Sadly, though, the TextMate user may have less influence over the version control system she/he must use than she/he would like.
In the course of a day I mostly work with files under version control. During the course of a day I open many, many files in TextMate for viewing, with no intention of editing. If every file I open for viewing gets checked out for edit (in the perforce sense), it is a hassle for me to revert those files later, and other users get warnings that I have those files open for edit when I don't actually intend to edit them. The warnings which are actually somewhat useful, degenerate to noise if every file I merely open for reading is opened for edit in the eyes of the version control system.
I'm NOT saying that the ability to hook into a file opening event is at all a bad thing. I am suspicious of hooking a version control operation into it though. If a file opening hook were available, and a version control bundle hooked it, I would hope that the hook would be an opt-in setting and not on by default.
More generally, I would like TextMate to treat read-only files as exactly that: read only and un-editable until I explicitly say I want to override the read-only status either by simply flipping a write flag, or a more involved version control system operation.
-john
(And BTW, does anyone in particular own the Perforce bundle? I've been adding some odds and ends to my copy of it...)
On 10/2/2006, at 22:09, John Fieber wrote:
(And BTW, does anyone in particular own the Perforce bundle? I've been adding some odds and ends to my copy of it...)
If someone does, it would be Chris Thomas.
But if you have suggested improvements/additions, just send patches to this list.
On 10/2/2006, at 19:23, Oscar Bonilla wrote:
Is there a way to run some code from a Bundle before TextMate opens a file? [...]
Currently not, no. But I am currently in the midst of rewriting/ redesigning basically everything about TextMate and “file access” where I do plan to allow various hooks, virtual file systems, get rid of the polling (when possible), track files via aliases, etc.
I also have a request for a hook when a read-only file is first edited (Perforce), which likely will also be possible.
All this is however part of a major revamp of a lot of things in TextMate, so betas from this branch are not planned/possible for the nearest future.