What every Subversion user must know about Git

Subversion is perfect (simple concept, lots of books, good tool integration, and easy to use) but for the fact that it doesn’t support:

While the former should be addressed in version 1.5, the latter is anyone’s guess.

The problem is that Subversion is just so good that eventually you will will want a distributed mode with Subversion.

Fortunately, Git supports distributed operation against Subversion repositories!

If this gets you “on the Git bus”, check out this:

An introduction to git-svn for Subversion/SVK users and deserters.

(Thanks Geoff for the links)

Addendum 05/03/08:

Tonight I tested out setting up cygwin from scratch to use Git, and in doing so confirmed what I knew and discovered what I didn’t!

You must use the following packages:

  1. Git 1.5.5.1-1
  2. Subversion 1.4.5-2
  3. Subversion-perl 1.4.5-2

Failure to install the subversion-perl bindings results in the error: = Can’t locate SVN/Core.pm in @INC

Thank you ycdtosa for the pointer!

Addendum 05/03/08:

If, like many of us, you haven’t fully cut over to cygwin, you may receive the following error message when you attempt a commit:

You have some suspicious patch lines=

Here is both an explanation of and a work-around for the error.

To solve the problem, you need to edit .git/hooks/pre-commit and comment out the following lines:

=if ($) { bad_line(“trailing whitespace”, $_); }=

Before tonight, I figured that I would never have the need to use dos2unix ever again! Based on one of the commentors replies, though, I expect that further research on the operation of Git is required on my part in order work between CR and CRLF environments:

Git from some time has core.autocrlf and crlf attribute, which should help in mixed UNIX (LF) and Windows (CR LF) environment

Just 3 little words

On my previous project, we had just a bang-up bunch of guys on the team. Everyone was smart, thoughtful, and worked well together: it was ideal. Since there was no revision control system in place when we arrived for the project, we decided to use Subversion. Since I had championed Subversion, I became both the Subversion system and repository administrator.

After a few months, and few thousand commits (a lot of them without any commit messages) I decided to add a commit hook script to prevent commits without comments. To be fair, I figured that no one would mind being required to write commit messages that were as long as they had already been writing, so I wrote a script to get the mean number of words in the commit messages (to date) that were not empty. The average was 7.

7 is a good number, at least enough to convey the “why” with enough brevity to make the RCS helpful. That said, I figured I would be even more accommodating of the users and require only a mere 3 words in every commit message. I made the change, tested it out, and deployed it to the Subversion server.

Eager to view the informative commit messages that would surely result from this new “feature”, the next day I took at look at the first commit message that followed the change:

“#!@& YOU GRANT”

Thanks guys, you gave me my favorite Subversion story.

Graphviz

Graphviz, or Graph Visualization Software, is a gem of a program. By specifying graph relationships in plain text files, you can create and publish graph diagrams (in just about any format) to serve any number of purposes including the visualization graphs (of course!) and anything else that can be represented by a graphs like UML, class diagrams, state machines, network architecture, system design, and even code! This is a perfect tool for any developer.
Here are some screenshots; but don’t be limited by what you see. Use your imagination!

Switching Caps Lock with Control on Windows

Getting the control key “back into the right spot” on PC keyboards is a goal shared between Emacs and UNIX folks. The following are a collection of links on how to do so (this list is sure to grow):

Addendum: 10/01/08
The Sysinternals solution is excellent, but it throws away caps lock. This was fine for me for a while, but believe it or not, now I need it back. As such, I now employ the solution found here.

Addendum: 1/11/11
This approach does not work on Windows 7 (I just started using Win7 this week).
KeyMapper works brilliantly though.
(via emacswiki)
Addendum: 2014-12-10

Coming back to Windows I found that KeyMapper quit working for me.

AutoHotkey seems to be doing the job of swapping:

  • caps lock with left control
  • left control with caps lock
  • enter with right control
  • right shift with enter
    • Seems to be the best way to use any keyboard out there
  • scroll up and down on the wheel mouse

Alt (Meta) - Enter doesn’t seem to work.

I’ll keep at it. Here is the config.

WheelUp::
Send {WheelDown}
Return
WheelDown::
Send {WheelUp}
Return
Capslock::Ctrl
LCtrl::CapsLock
Enter::RCtrl
RShift::Enter

Encript-ing Scheme

Enscript is such a versatile and helpful tool.
Here is how I use it to pretty print Scheme code:

enscript --landscape --columns=2 --highlight=scheme --borders --line-numbers --output=.ps .ss

Addendum: 03/06/09
Here is the direct link for the GnuWin32 download of Enscript.
Addendum: 03/08/09
Here are my new favorite settings for rendering code with this excellent program:

enscript --word-wrap --underlay=Underlay --ul-gray=0.9 --line-numbers --
landscape --highlight=scheme --columns=2 --borders --output=test.ps C:\collects\wisdomandwonder\resume\latex-renderer.sls

DrScheme: Insert Lambda Template Keybinding

DrScheme provides a very versatile keybinding system. Out of the box you get bindings that make it very easy to navigate and even refactor your code. One keybinding, insert-lambda-template, works by surrounding the selected code with a lambda function. By default, insert-lambda-template uses the lowercase lambda symbol λ rather than the word lambda. As DrScheme encodes its files in utf-8 it has got no problems with this (in fact DrScheme has shortcuts for inserting most other Greek characters), but if you use other tools to edit or process your source code you may find that they (quite disappointingly) choke on it. For that reason, I wanted to modify the keybinding so that it would use the world lambda rather than the symbol. There are two ways to go about doing this.
The first involves modifying the source code of DrScheme itself. This sounds harder than it is as it doesn’t even involve downloading the source code. When you install DrScheme, it includes a number of source files used to customize itself. If you wanted, you could look up this keybinding, change it, and re-run the setup program. I don’t like this approach, though, since it forces the user to re-build part of the program. That leaves us with the second alternative, a custom keybinding.
A custom keybinding is easy to implement and add. To write it, I copied the definition of insert-lambda-template and changed the lambda symbol to the word lambda. Next, I went through DrScheme’s Edit->Keybindings menu to select Add User-defined Keybinding. That is all it takes.
My keybinding file can be downloaded here.

DrSync: Automatically synchronize file changes in DrScheme v370 and above

DrSync is a plugin that saves your files on frame deactivation and reverts them on frame activation. This tool is of particular interest to folks who run external programs like version control or build related tools on files which they are editing inside of DrScheme.
Continue reading “DrSync: Automatically synchronize file changes in DrScheme v370 and above”