#480 closed task (fixed)
Cleaning Subversion svn:keywords — at Version 5
Reported by: | mloskot | Owned by: | mloskot |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | Default | Version: | main |
Severity: | Unassigned | Keywords: | |
Cc: |
Description (last modified by )
This task follows the motion of moving GEOS to GitHub.
The Subversion keywords like $Id$ should be completely cleaned. Quoting the Git FAQ:
Does git have keyword expansion? Not recommended. Keyword expansion causes all sorts of strange problems and isn't really useful anyway, especially within the context of an SCM.
Linus Torvalds answers Does GIT has vc keywords like CVS/Subversion?
Clean-up Procedure
First, svn:keywords property is removed:
find . -path '*/.svn' -prune -o -type f -print | xargs svn propdel -q svn:keywords
Next, line consisting of $Id$ keyword is stripped from every plain text file using a tiny script coded in Python:
#! /usr/bin/env python import fileinput import re import sys def strip_line(filename, rx): sys.stderr.write(filename + '\n') for line in fileinput.input(filename, inplace=1): m = re.match(rx, line) if m is None: sys.stdout.write(line) else: sys.stderr.write(line) if len(sys.argv) < 2: sys.exit("Missing filename") pattern = '^.*\$Id.*$' rx = re.compile(pattern, re.DOTALL) strip_line(sys.argv[1], rx)
The script is executed for every file, excluding the working copy admin area in .svn:
for f in `find . -path '*/.svn' -prune -o -type f -print`; do ~/bin/strip_line_regex.py $f; done;
Change History (5)
comment:1 by , 13 years ago
Description: | modified (diff) |
---|---|
Owner: | changed from | to
Status: | new → assigned |
comment:2 by , 13 years ago
comment:3 by , 13 years ago
Description: | modified (diff) |
---|
comment:4 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Removed Subversion Id keyword from all text files r3482
comment:5 by , 13 years ago
Description: | modified (diff) |
---|
Note:
See TracTickets
for help on using tickets.
Removed Subversion svn:keywords property r3481