Howto use Git and svn together
In these days I’ve heard lot of rumors around Git. After reading some manual/tutorial/guide I discovered that it can be really useful, especially if you spend lot of time coding off-line (that’s my situation).
This is a really small howto that describes how to work on a project versioned with svn (maybe taken from KDE repository ;) ) using git.
What’re the advantages?
Since Git is a distributed revision control system (while svn is a centralized one) you can perform commits, brances, merges,… on your local working dir without being connected to internet.
Next time you’ll be online, you will be able to “push” your changes back to the central svn server.
Steps to follow:
You’ve to:
- install git and git-svn
- create the working dir:
mkdir strigi - init your git working dir:
cd strigi && git-svn init https://svn.kde.org/home/kde/trunk/kdesupport/strigigit-svn init command is followed by the address of the svn repository (in this case we point to strigi’s repository) - Find a commit regarding the project (you can get it from cia version control). Warning: the command git-log will show project’s history starting from this revision.
- Perform the command
git-svn fetch -rREVISIONWhere REVISION is the number obtained before. - Update your working dir:
git-svn rebaseNow you’ll be able to work on your project using git as revision control system.
To keep update your working copy just perform:
git-svn rebase
You can **commit your changes ** to the svn server using the command:
git-svn dcommit
In this way each commit made with git will be “transformed” into a svn one.
Solve git-svn rebase problems
While adding new cool features to your program, you may experiment some
problem when synchronizing with the main development tree. In fact you have to
commit all local modifications (using the git-commit command) before
invoking git-svn rebase.
Sometimes it isn’t reasonable since your changes are not yet ready to be committed (you haven’t finished/tested/improved your work). But don’t worry, git has a native solution also for this problem, just follow these steps:
- put aside your changes using the command:
git-stash - update your working copy using:
git-svn rebaseas usual - take back your changes typing:
git-stash apply - clear “the stash” typing:
git-stash clearAfter the first step all your uncommitted changes will disappear from the working copy, so you’ll be able to perform the rebase command without problems.
For further informations read git-stash man page.
That’s all.
A special mention goes to Thiago Macieira for his help.
Automatically Upgrade Your Wordpress
Today I upgraded my Wordpress from 2.2.1 to 2.2.2. They didn't change many things, it was only a security update. So, being not a major update, it is possible to copy the new wordpress files overwriting the old files from your installation, without being necessary to update your database. This worked well, but here I want to point the other method to update your wordpress blog, using a plugin that will upgrade your blog automatically to the latest version. The plugin can be downloaded here and the detailed instructions to using it are here.
The steps which the plugin does;
1. Backs up the files and database and makes them available for
download.
2. Downloads the latest files from http://wordpress.org/latest.zip and
unpack it.
3. Puts the site in maintenance mode, deactivates all active plugins
and will enable them at the end.
4. Upgrades wordpress files and give you the possibility to upgrade the
database.
5. Re-activates the plugins.
If you don't want to see/use the intermediate steps let the plugin to be run in an automated mode, and you don't have to carry about, you will see only the final page and you are invited to check your blog.
That's all .
Minor problems in my case:
1. the plugin had no rights to write in wordpress install directory, so I had to fix this first, and rerun the update
2. all plugins were activated but only the sidebar plugin was not activated at the end, so, it was necessary to activate it manually
Strigi gains full Xesam queries support
As I said in this previous post, Strigi’s Xesam support was half-done since XesamUserSearchLanguage wasn’t yet handled. Well, this is no longer true… ;) In these weeks I’ve been working on XesamUserSearchLanguage support. Ehm… to be honest, I’ve been fighting with Bison.
But in the end I tamed the beast and now Xesam support in Strigi is full.
IMHO XesamUserSearchLanguage can be considered more important than XesamQueryLanguage since common users will write queries in this way.
As reported on the project page: {% blockquote %} It is [XesamUserSearchLanguage] designed as an extended synthesis of Apple’s spotlight and Google’s search languages. {% endblockquote %}
These are some possible queries (examples taken from freedesktop site):
-
_type:music hendrix_will return all music items related to hendrix -
_type:image size>=1mb tag:flower africa_will return all pictures displaying a flower greater than 1 Mb and related with africa
Technical aspects
The Xesam’s UserSearchLanguage query –> Strigi::Query object conversion is made using a hand-written scanner and a C++ parser created by Bison.
You don’t have to worry if you don’t have Bison installed on your system since all parser generated code is already put into svn. In these days, as soon as I’ll have some spare time (when?!), I’ll write another post about open-source scanner and parser generators.
By now I would like to thank Andreas Pakulat (developer of KDevelop) for his help with parser generators.
s/evento/acontecimiento/
s/evento/acontecimiento/. Por favor.
(En el evento que lo de que hablas sea un evento sigue usando evento.)
I like emacs.
;; Temporarily comment out %gconf_schemas_prereq, %lang_package,
;; %files lang, etc.
;; Useful when using quilt setup. Don't forget to save. You can
;; undo this with M-x ab-undumb-down-spec.
(require 'cl)
(setf replacements '(("^%gconf_schemas_prereq"
"# GCONF_SCHEMAS_PREREQ"
"%gconf_schemas_prereq")
("^%lang_package"
"# LANG_PACKAGE"
"%lang_package")
("^%files lang"
"# FILES LANG" "%files lang")
("^gnome-patch-translation-prepare"
"# GNOME-PATCH-TRANSLATION-PREPARE"
"gnome-patch-translation-prepare")
("^gnome-patch-translation-update"
"# GNOME-PATCH-TRANSLATION-UPDATE"
"gnome-patch-translation-update")))
(defun ab-dumb-down-spec ()
(interactive)
(let ((old-pnt (point-marker)))
(progn (mapcar (lambda (arg)
(progn (beginning-of-buffer)
(replace-regexp (first arg) (second arg))))
replacements)
(goto-char old-pnt))))
(defun ab-undumb-down-spec ()
(interactive)
(let ((old-pnt (point-marker)))
(progn (mapcar (lambda (arg)
(progn (beginning-of-buffer)
(replace-string (second arg) (third arg))))
replacements)
(goto-char old-pnt))))
Adding new pieces of text to replace and unreplace is easy: add a list containing a regular expression matching the text to destroy, a(n ideally) unique temporary replacement, and the original text to replacements. I use a regexp in the cars in case there's the same text elsewhere, which I wouldn't want to change.
Now I visit a .spec file, run M-x ab-dumb-down-spec, do quilt setup whatever.spec and other quilty things, and then revisit the .spec and do M-x ab-undumb-down-spec prior to doing actual builds.
(By the way, the meat of this post was created by setting a region around this chunk of lisp and running M-x htmlize, although it looks like blogger is eating the colors.)
Graph creating libraries for PHP
PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. It is a very nice, used and easy to learn web programming language. I decided to play arround a bit with it and for this I needed a graph library to create dynamic scientific, business and stock-market charts. So, trying to find something I stopped on these two: PHPlot and JpGraph which are fine for my needs. You also can find useful to look for a nice Tutorial for Component Graph. I finish by tell you “happy programming and nice plots with PHP”.
136 years of solitude
/dev/sda2 has gone 49680 days without being checked, check forced.
back home
I got stuck in an extra small seat from CDG to MEX -- there was a big metal box under the seat in front of me bolted to the floor and occupying about 1/3 of the "legroom". At 193cm tall, I find all seats cramped, but this was ridiculous. Ridiculously uncomfortable, that is.
Being back at home is like stepping into a pair of old, comfortable shoes.
in Germany
Seeing people whom I mostly know as email addresses and IRC nicks has been productive and nice, of course. That's the real value in this sort of trip.
Status of my
Hi Thomas,
thanks for the question. Here is the status:
| Tables: | |
|---|---|
| * introduce allowCollapse attribute for paragraphs following nested tables to encode WW and HTML-like tables. | Not put up for discussion. |
| * declare sub tables as deprecated | Under discussion in the Accessibility SC. |
| Numbering | |
| * introduce text:level-text attribute to encode arbitrary number formats | Rejected. |
| * introduce text:num-follow-char to encode WW-like numbering | Partly accepted. |
| * introduce text:list-override to encode WW-like numbering | Strongly rejected. |
| * declare style:list-level-properties/@text:space-before as deprecated. Effect can be achieved with paragraph indent. | Rejected. |
| Master-page styles | |
| * add header-first and footer-first to encode WW-like page-styles | Not put up for discussion |
| * modify master-page styles such that WW-like sections can be encoded; current CSS3.0 like text:sections are not applicable | Not put up for discussion |
| * declare the style:next-style-name attribute of master-page declarations as deprecated. | Not put up for discussion |
| Styles: | |
| * allow deriving paragraph-family styles from text-family styles. | Not put up for discussion |
| "Break chars" | |
| * introduce a |
Not put up for discussion |
| Fields: | |
| * enhance field support by introducing a <text:field-start/> and a <text:field-end/> element to which metadata can be attached. | Rejected |
| Change tracking: | |
| * introduce change tracking for tables | Not put up for discussion |
| * introduce change tracking on property level | Not put up for discussion |
| Discourage the use of the following OD features for MOOX interop: | |
| * nested frames | Not put up for discussion / Internally communicated as rejected. |
| * current CSS3.0 like text:sections | Not put up for discussion / Internally communicated as rejected. |
| * use fo:break-before instead of fo:break-after | Not put up for discussion / Internally communicated as rejected. |
| * use fo:margin-* for tables | Not put up for discussion / Internally communicated as rejected. |
In general I must confess the OpenDocument TC didn't picked up my discsussion topics... (It's listed as suggested but never has been put for discussion into the agenda). Additionally I had a lot of private communiation where my ideas where communicated as unwanted/rejected.
To get an idea of whats discussed for ODF1.2 take a look at: