How to change the default branch name for `git init`

When a new Git repository is initialized using git init, the default name of the main branch that is created is “master” (likely based on the terminology used in BitKeeper, which Git was created to replace).

Update Nov 2020: This is now the default in Git.

For the past 20+ years, the usage of “master/slave” terminology has been criticized as needlessly reproducing racist terminology of slavery, and in the course of 2020, this discussion has finally broadly reached Git as well, with calls to rename the default branch to “main” or “trunk” instead (previously, this had been proposed for specific projects, e.g. GNOME in 2019).

Petr Baudis, who picked the names way back in 2005, weighed in to state that they wish they had picked “main” instead. Using “main” instead of “master” has the benefit that it autocompletes with “m” and “ma” as well, and is also the term GitHub (who still collaborate with ICE) are switching to.

Currently, the branch name a new repository is initialized with is hard-coded in Git, so there are two options to change the default (to “main”, in the following examples):

  1. Changing the HEAD pointer before the first commit, using the symbolic-ref subcommand: git symbolic-ref HEAD refs/head/main or manually overwriting the .git/HEAD file: echo 'refs: refs/head/main' >.git/HEAD;
  2. Putting this change into a git template, by copying the default git template: cp -r /usr/share/git-core/templates ~/git/template, adding the ref pointer: echo 'ref: refs/heads/main' >~/git/template/HEAD, and passing that directory to git init in the --template= option (or setting init.templateDir).

If you want to easily change the main branch name of existing repositories, you can just run git branch -m master main && git push -u origin main. Remember to adapt any settings or scripts that might refer to branches by name, such as CI/CD, “protected branches”, etc.!

The Unfeeling Protectors

[CN references to violence, toxic masculinity, rape]

Gabrielle Blair aka Design Mom posted a thread on Twitter about (usually white, usually cis) men and their fantasies around “protecting their families” that are actually fantasies of “justified” violence.

Luckily, she also posted it on her blog, where it’s easy to read and not subject to the Twitter privacy-stripping, engagement-driven thought blender:

[Men are] picturing some great thing — having to protect their family at gun point from a clear and present danger. When the actual instructions for protecting the family are simpler, they are no longer interested.

One can rightfully argue that the US is a special case, with its insane gun laws, shaped by a strong lobby group influencing politics against the public majority, leading to the highest rates of gun violence within their socioeconomic group of countries. But the thinking behind these “protect my family” fantasies is the same in “conservative” and far-right circles here in Europe and likely worldwide.

It’s the fantasy of replacing with violence, justified by pseudo-morals, anything resembling emotion, care, reflection. These men like to feel powerful, and power and violence are inextricably linked in their minds. Conversely, anything that is not violent must thus diminish their power.

Calling all audio and hardware hackers!

I am part of c3lingo, a community of interpreters offering simultaneous translations at cultural and social events such as Chaos Communications Congress and Camp, Fusion Festival, TIN-Solifest and others.

The project has been running for many years, but especially since we are increasingly active outside of C3, we have some hardware challenges as there is often no pre-existing infrastructure and/or little budget for hardware.

That’s why we want to build our own interpreting consoles that are as open and free as possible, inexpensive to buy, and customized to our use-case.

I am looking for more information and support with knowledge, tips, and also active help with planning and construction. More details below.

Continue reading “Calling all audio and hardware hackers!”

Oh, how history’s repeating

It’s been five years, which in Twitter terms is, like, three eternities, min!

A little over five years ago, I was fed up. With Twitter in particular, but also with the “Web 2.0” in general. It all felt off to me, the competition for the quippiest quip, the most outrageous statement in so many variations, the most interactions, impressions, counters going up. Both on the site and behind the scenes, everybody and everything was replaced with carelessness, it seemed. Product managers and engineers and designers build things they don’t really understand or care about, for users who don’t really care to use to “increase reach” or “activate audiences”.

There is another aspect, and that is control and data sovereignty. Without open APIs, without clear delineations of what data I own, what data someone else has, who controls what data and what is done with it, the power asymmetry of using centralized services has no chance of ever going away. Twitter had been limiting and shutting down their APIs over years, strangling the ecosystem in the process: alternative clients (which would not show ads, or not follow the product “strategy” Twitter supposedly had), bots (some of which were used for evil, as things go), analytics (with their implications for user privacy as well as making Twitter-the-company measurable), and more. It made me dislike Twitter and I did not want to use it anymore.

But of course I did. For five more years, in fact. Because even while it declined in so many ways, it was also reinvigorated, as well as plainly addictive. (Now that I know I have ADHD, many things are much clearer. Hindsight and all that.) Twitter was at once a tool for activism for social justice as well as a tool for disinformation campaigns at any and all scales, some of which were unprecedented (as far as we know). It was emotional, it was activist, it was outrageous, it was communal, it was solidarity. I met new people, made new friends, new enemies, suffered, rejoiced.

No more. All my criticism from the past still holds, and then some new ones. Twitter, as a platform, has become wholly too self-important. Maybe even too actually-important, it’s hard to say. A fitting analogy I saw (on Twitter, of course) was that of a spent fuel pool. The highly radioactive outrage is focused on Twitter, often a tempest in a teapot, and only after it has had its turn, has decayed sufficiently to be exposed to the world at large, does the topic du jour become part of the mainstream narrative – or, in many cases and just as well, it doesn’t. If everything is important, an outrage, a scandal, a shitstorm and a hashtag, might as well that nothing is.

That is evidently false. A great many things, among them social justice, fighting climate change, smashing capitalism and rebuilding a communal society, are indeed important. But if the interactions are limited, broken up into 280 characters, starting a fission reaction if “successful”, releasing a lot of energy and rapidly decaying? That doesn’t do it justice. Neither can the momentum be harvested – everything is in the walled garden, no, reaction chamber, shielded except for very clearly defined interfaces, the most rebellious of which is likely the screencap.

Now, what then? Federated and open networks like Mastodon solve some of the issues, but the social graph is yet strong even as Twitter is trying to damage it beyond repair, and the user experience of federated systems is still lagging. Maybe we just need to manage people’s expectations better? It’s not like any of the centralized platforms gives you access to the world’s population – there’s a lot of social justice to be done before that is even possible – but it sure feels that way for the selected few. Discovery at scale for distributed systems is hard; can we hide that complexity behind a different abstraction than centralized platforms with highly-paid engineers?

A lot of words to say that I have, again, left Twitter. That I don’t see myself coming back this time, but who knows. That I wish things had gone differently with personal websites and blogs and XFN and RDF and all that.

In the (potential) next installments, I’ll look back at the “blogosphere” and its protocols, and how we can try to excavate and reuse some parts of it.

Im Nachhinein

Was hat zwei Daumen, zwei Kater, eine leichte Gehirnerschütterung und beim Froschpoker die Augen gewonnen?

That’s right.

This guy.

Im Nachhinein war es vielleicht nicht so klug, mehrere Stunden zu dadaistisch-anarchischer Musik zu hüpfen. Aber scheiß auf klug, wenn man auch Spaß haben kann. Zum Abschluss des 32c3 traten HGich.T in der Lounge auf, und dann wurde ich zu einer lustig hüpfenden Mischung aus Schweiß (meinem eigenen), Bier (dem anderer Leute), Wasser (es gab kein stilles), und Sekt (von der Band). Ich bekam einen Baum, wir formten einen Wald, Dinge waren Laser und bunt.

Ein überaus gelungener Abschluss zu einem für mich sehr ambivalenten Congress.

Code of Conduct

Codes of Conduct beinhalten ein »philosophisches« Statement zum Selbstverständnis der Organisation oder der Veranstaltung, definieren unerwünschtes und ggf. sanktioniertes Verhalten, und erklären, wie solches Verhalten behandelt und ggf. sanktioniert wird. Unerwünschte Verhaltensweisen sind häufigerweise Drohungen, Stalking, Störungen von Talks u.a., sexuelle Belästigung, diskriminierende Bilder, Kommentare oder Witze, und weiteres Übergriffiges.

Was bedeutet es also, wenn jemand einer Veranstaltung fernbleibt, weil diese einen solchen Code of Conduct hat?

  1. Die Person hat ein Problem damit, dass übergriffiges Verhalten explizit als unerwünscht markiert und ggf. sanktioniert werden kann, oder damit, dass die Veranstalter sich über die Schaffung von sichereren Kontexten Gedanken gemacht haben; oder
  2. Die Person hat sich mit der Thematik nie befasst, weil sie sich nie damit befassen musste, z.B. weil sie dank privilegierter Stellung nie Opfer von struktureller Diskriminierung oder sexuellen Übergriffen wurde, und nimmt die Tatsache, dass mehr und mehr darüber geschrieben und geredet wird und dass mehr und mehr Events Codes of Conduct erarbeiten und veröffentlichen, nicht als Anlass, darüber nachzudenken.

Good riddance.

BIGINTs in rails as primary keys

(This is an update to my older post on bigints in rails migrations.)

BIGINT columns in rails have always been a little annoying to work with, which is why I published a blog post on how to do it, five years ago, to serve as a reminder to myself and as a resource to others. BIGINT primary keys were even more hit-and-miss.

Enter Ryuta “kamipo” Kamizono, who took to improving rails’ support for this, created a pull request “Allow limit option for MySQL bigint primary key support,” and landed that in rails:master last month, which allows you to write things like this:

create_table :foos, id: :primary_key, limit: 8 do |t|

# or

create_table :foos, id: false do |t|
  t.primary_key :id, limit: 8

The patch should be included in the next release of rails. Happy hacking!

Integer vs to_i in Ruby

Since this has recently come up in a work context, I would like to take this opportunity to remind everyone to always specify the expected base when trying to convert strings to integers using Integer(value), because as opposed to String#to_i, the Integer(…) constructor does honor prefixes like 0 for octal, 0x for hexadecimal, etc.


Integer("0462011540000077")  #=> 21029460115519
Integer("0461990540002606")  #=> ArgumentError
"0462011540000077".to_i #=> 462011540000077
"0461990540002606".to_i #=> 461990540002606
# now, specify the base explicitly:
Integer("0461990540002606", 10)  #=> 461990540002606

The same thing happened with JavaScript’s parseInt and bit lots of people, so: cover your bases.

Ruby documentation for Integer()