Convert a git repository from submodules to subtrees

Git submodules and git subrees are well explained in the git-scm book. Here's a small script that automatically converts the former to the later:
cat .gitmodules |while read i
do
  if [[ $i == \[submodule* ]]; then
    mpath=$(echo $i | cut -d\" -f2)
    read i; read i;
    murl=$(echo $i|cut -d\  -f3)
    mcommit=`eval "git submodule status ${mpath} |cut -d\  -f2"`
    mname=$(basename $mpath)
    echo -e "$name\t$mpath\t$murl\t$mcommit"
    git submodule deinit $mpath
    git rm -r --cached $mpath
    rm -rf $mpath
    git remote add $mname $murl
    git fetch $mname
    git branch _$mname $mcommit
    git read-tree --prefix=$mpath/ -u _$mname
fi
done
git rm .gitmodules

OK… Here's another way to add random signatures to Gmail. Now using Google Apps Script.

It almost works. It will update signatures that you store in a Google Sheet at regular intervals. The only problem is… You have to be a Google Apps for Business administrator to run this thing, because the only way to update a Gmail signature programmatically is via the Google Apps for Business Admin SDK. Ha-ha. Another problem is tha the signature only gets updated when you refresh the page. But that's a minor thing ;-)

Check it out and make a copy to have access to the script.. And here's the code:

On the usefulness of Akoma Ntoso

There's been very few laws that I followed closely, but all of them had a direct impact on my life, so I took this seriously. I didn't actually follow laws, but rather legislative processes because I either wanted a change or I was averse to it. In both cases, the object of interest was not a law itself, but its evolution.

You should already know that most laws are hand-crafted patches applied to previous laws. There are virtually no laws that are written from scratch, one notable exception is the constitution. Other laws refer to past laws.

For example, today's law that extends the powers of the Belgian intelligence service is a patch applied to the law that created the service in 1996, and it says literally this:

  • Go the the article 3 of the past law and append this extra paragraph
  • commit your changes in the legislative branch
  • push to the executive branch

If you go and search for the original law, you won't find it that easily, because laws were digitized back to 1998, while the original law dates from 1996. If you are lucky, you'll have free online access to the so-called 'consolidated' version of the law. That is, a version with all the patches applied. However:

3 disruptive technologies that will change policymaking

Version-controlled laws

Here's a EurActiv article that gives a bird's eye view of the subject of version control systems applied to legislation.

End-to-end verifiable anonymous voting

This one is better explained by Wikipedia. Here's the description of the simplest of such voting systems.

Inline comments

Here's the best implementation of inline comments until now.

 

Tags: 

When EU institutions write about opensource… it reads like a good joke

Here is an excerpt of the Legal aspects of free and open source software workshop notes. Every phrase is a masterpiece.

"When the public agency has decided that open source requirements are particularly important for a specific software acquisition case, the process described in this section can be followed. This process would end in the agency downloading open source software itself, with no fee paid whatsoever. Separately, commercially provided services and support, if required, may be acquired by publishing calls for tender. Note that this process can be abandoned at any point - for instance, if the software cannot be found easily, or evaluated, or once downloaded is found unsuitable for any reason. At that point, the other approach described in the next section can be followed, namely, publishing a call for tender for open source software."

Pages