subversion

Working with a Subversion repository through Git

25 May, 2009 - 13:53
Categories:

I'm experimenting with using a Subversion repository through Git. That way I can keep better track of my own (experimental) work, without polluting/destabilizing the central Subversion repository with small incremental commits. Git comes with a svn sub-tool that takes care of all the interfacing between the local git repository and the central Subversion repository. Mainly for my own reference, I'll collect some pointers and tricks for using this git-svn tool here. Maybe it's useful for other too.

Read more...

Ignore whitespace in Subversion diffs

20 May, 2009 - 15:24

When you're working on a software development project where not all parties use the same code style conventions or editor setting (like tabs vs. spaces, removing trailing spaces, etc), the signal to noise ratio of a source code diff can be a bit frustrating. Luckily, most diff programs have an option to ignore whitespace changes, for example -w or --ignore-all-space in GNU diff or colordiff.

The internal diff engine of Subversion also offers this option (since version 1.4 if I'm not mistaken), but it looks a bit weird to use it:

svn diff -x -w ventrolucator.cpp
Read more...

Subversion: undo committed changes

12 May, 2009 - 15:08
Categories:

How to undo/rollback a Subversion commit? A fairly basic question, but every time I need the answer, I can't manage to remember it from the previous time I did it. Asking Google helps eventually, but the signal to noise ratio of the top hits is a bit disappointing. This time I couldn't resist the urge to throw my own bot snack in the intertubes.

Say you just made a commit (revision 123 for file apple.py), you discovered (after the fact) that it was just crap and you want the previous version (revision 122) back.

Read more...

Color highlighted diffs with git, svn and cvs

4 May, 2009 - 08:57

At first, it seemed annoying, but now I really like that git uses a pager when it has to present something (e.g. a log or a diff) that is longer than your screen. Git even provides a built in option --color to show you a diff with helpful colors. I use this option all the time and made a shortcut dic for it with the following command

git config --global alias.dic "diff --color"

Also possible is to edit your ~/.gitconfig directly so you have something like the following in there:

[alias]
        di = diff
        dic = diff --color

Now I just do

git dic

and I get a nice paged and color highlighted diff.

Read more...

Flag a PDF file as binary for Subversion

11 December, 2008 - 01:05

Sometimes, Subversion thinks that a PDF is a text file, instead of binary data. This can hurt during commits or diffs, because Subversion tries to do textual diffs with binary data.

Solution: you can explicitly flag the file as PDF data and Subversion will handle it as binary from then:

svn propset svn:mime-type application/pdf yourPDFfile.pdf

2345

26 August, 2008 - 20:48
Categories:

Yet another dull "numbers are so uncool" blog entry:
I just committed revision 2345 to my subversion repository. Yay.

Apart from having four consecutive digit, there's nothing special about 2345 actually.
In hexadecimal: 929, pfft
In binary: 100100101001, almost, but no sigar
Prime factorization: 5 x 7 x 67, boooring

bleh

Script for easier adding subversion ignore rules

4 July, 2008 - 11:16
Categories:

It's possible to make Subversion ignore unversioned files, so they don't show up in the status overview and you get a better signal to noise ratio. The command line interface to add ignore rules this is however a bit clunky. First, you need to remember following command:

svn propedit svn:ignore .

(which can be quite confusing, especially with the slightly similar looking but different propset command).
Then you get a file editor where you have to add the rule (make sure you remembered the file name or pattern you want to ignore), save the file and exit the editor.
A bit too much hoops to jump through for something that could be just one command like svn-ignore filename.

Read more...

Parsing the subversion Id keyword with python

19 February, 2008 - 11:07

Another one for the category 'remainder-to-self' or 'write-it-on-a-sticky-note-somewhere'.
Parsing a subversion Id keyword is just a matter of some regular expression magic:

# use the built in regular expression library
import re
 
# the subversion Id keyword
svnid = '$Id: svnidparse.py 1234 2008-02-19 09:59:27Z joske $'
 
# bow for the mighty regular expression
svnidrep = r'^\$Id: (?P<filename>.+) (?P<revision>\d+) (?P<date>\d{4}-\d{2}-\d{1,2}) (?P<time>\d{2}:\d{2}:\d{2})Z (?P<user>\w+) \$$'
 
# parse the svn Id
mo = re.match(svnidrep, svnid)
 
# use it, like for example:
print 'this is %s - revision %s (%s)' % mo.group('filename', 'revision', 'date')

hmm, calling it "black magic" would be better, probably.

LaTeX trick: putting the subversion revision number on every page

8 February, 2008 - 18:40
Categories:

I mostly use LaTeX for writing documents (LyX actually, but that doesn't matter here) and use Subversion for the version control. For managing the revision info of a source code file I use Subversion's built in feature Keyword Substitution which expands some special keyword (like $Date$ or $Revision$) in the source code to their current values.

Now two questions arise here:

  1. How to get the Subversion keywords nicely into LaTeX? Note that the $ character used for the Subversion keywords is already a reserved LaTeX control character and make things messy.
  2. How to get the version info on every page (e.g. as a footer)?
Read more...

wwww wwww wwww

21 November, 2007 - 19:26

Today I committed revision 1830 to my work's subversion repository.
1830 might seem like a boring number, but given the current political crisis in Belgium, it is a bit special.

(about the title: hint)

PS: I know this is a crap blog entry, but this blog has been "unalive" too long and needed some reanimation.