Skip to main content

Posts

Git for Insidrrrs

Today I did a quick Git intro for the fine folks at the second Insidrrr Day in Cologne. Photo by Erik Sixt @insidrrr I think it was the first time I ever did a presentation which wasn't purely aimed at programmers, as there were a lot of media/designer types in the crowd. Hopefully I managed to stay away from programming lingo enough for them to grasp what Git is about. The presentation is available here .

Git Stash Blooper (Could not restore untracked files from stash)

The other day I accidentally did a git stash -a , which means it stashes *everything*, including ignored output files (target, build, classes, etc). Ooooops.. What I meant to do was git stash -u , meaning stash modifications plus untracked new files. Anyhows, I ended up with a big fat stash I couldn't get back out. Each time I tried, I got something like this: .../target/temp/dozer.jar already exists, no checkout .../target/temp/core.jar already exists, no checkout .../target/temp/joda-time.jar already exists, no checkout .../target/foo.war already exists, no checkout Could not restore untracked files from stash No matter how I tried checking out different revisions (like the one where I actually made the stash), or using --force, I got the same error. Now these were one of those "keep cool for a second, there's a git way to fix this"situation. I figured: A stash is basically a commit. If we look at my recent commits using   git log --graph --...

Filtering out illegal characters using Guava

The other day, I needed to validate a text-field against a whitelist of characters. Actually, lots of text-fields needed lots of different sets of whitelists, but let's just stick to one for the sake of example. The text field "First name" is only allowed to contain any of these characters:   ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz°Žµ·žŒœŸÀÁÂÃÄÅÆ ÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝ Þßàáâãäåæçèéêëìíîï     ðñòóôõöøùúûüýþÿ .. and the user should be notified with which illegal characters she has entered in the field, if any. The knee-jerk reaction to this kind of logic is regular expressions, but my knee-jerk reaction to regexp is  to avoid it. The above character set probably doesn't fit with any of the predefined regexp notations, so it would probably be nasty anyway. Some  Guava fruits for coloring up this blog post ( image source ) So, let's put Google Guava to some use. It has some nifty utilities for working with sets   and other collect...

Stop using GitX - use GitX (L) instead

I noticed the other day that the Git homepage presents the original GitX as a GUI alternative on OS X. git-scm.com's GUI clients However, development on GitX ceased three years ag o, and while there is an interesting fork from Brotherbard  (development has ceased there as well), the most active continuation takes place in the fork  GitX (L) . The wiki of the orginal GitX  confirms this . A fellow called Erik Blomqvist has put up gitx.org which offers a more balanced view on the various forks. While there might be some value in the simplicity of the old GitX, three years is a long time in Git's development, and GitX is missing out on some newer Git features (like submodules). Anyhow, there are still a number of pages out there that says GitX is still the way to go. People are even still submitting stuff in the bug-tracker , which is awfully pointless, of course. Just keep this in mind next time someone asks you about a good Git GUI for Mac.

Flurfunk

A bit over a year ago, me and my colleague Felix started working on a little experimental project during our 20% time. As far as I can remember, we wanted to do some Clojure, and we wanted to make something that looked like a company-internal Twitter. We called it Flurfunk , which is the German word for "office talk" or something along those lines. After a few days of development, we set it up on an internal server, and it was already quite useful, as it was a nice way to group-chat with the whole team. We are co-located, so we don't really IM so much, but it's still nice for pasting URLs and unix one-liners, etc. We then proceeded to integrate it with our Jenkins build notification mails, and commit mails, so there's a nice timeline of what's going on. A bit like our team's heartbeat . A nice bonus is that if either of us are doing home-office, it's a nice way to interact with what the rest of the team is doing. We actually open-sourced...

Gitblit: Stories from the Field

Continuing my little tribute to the Gitblit 1.0 release , I asked some old colleagues of mine, Leif and Trygve , about their experiences with using Gitblit in practice. Q: How do you use Gitblit?   Leif: Webstep is a consultancy company, and we needed a Git repository for a specific client project that is being run in-house. At the moment the Gitblit server hosts three different projects, but only one is in active development. Trygve: I was working as a consultant in a team that was currently using Subversion, but wanted to switch to Git. IT were working on an installation of Gitorious, but the project didn't have a very high priority. As an intermediate solution I looked around for small, simple solutions for hosting a low number of repositories (around 10). As it was only our team that was going to use it, we didn't have any need for complicated security setups, just plain hosting. Having a web interface was a big plus as I wanted to show it was easy to create lots o...

Gitblit - The Little Git Repo Manager That Could

I've been tweeting about Gitblit every now and then, and also recommended it to people who want to run some Git infrastructure on Windows . Seeing Gitblit v1.0.0 was released a few hours ago  ( Google+ ), I would like to celebrate and congratulate the project with a two blog-posts. This is the first, and the second I hope to do soon in shape of some interviews with a couple of Gitblit users. Uh, what is a Git repository manager? It can be several things. Most people look for these features in a repo manager: A central place to share repositories A web-frontend for said repositories Manages users and access-control  Just to mention an alternative setup: At my dayjob, we use: A simple folder on a Linux server to put central repositories, accessible over SSH Gitweb as a web-frontend Access-control with SSH users and certificates We're quite happy with the above setup because we are a very Linux/Mac oriented shop, with a small team that have no fancy require...

The Git Users Mailing List

A year ago or so, I came across the Git-user mailing list (aka. "Git for human beings"). Over the year, I grew a little addicted to helping people out with their Git problems. When the new git-scm.com webpage launched , and the link to the mailing list had disappeared, I was quick to ask them to add it again . I think this mailing list fills an important hole in the Git community between: The Git developer mailing list git@vger.kernel.org  - which I find to be a bit too hard-core and scary for Git newbies. Besides, the Majordomo mailing list system is pretty archaic, and I personally can't stand browsing or searching in the Gmane archives. The IRC channel #git on Freenode, which is a bit out-of-reach for people who never experienced the glory days of IRC. Furthermore, when the channel is busy, it's a big pain to follow any discussion. StackOverflow questions tagged git , these come pretty close, but it's a bit hard to keep an overview of what questio...

The Anatomy of a Git Pull

Ever seen something like this? ➜  ~/projects/gitblit/[master]>git pull remote: Counting objects: 5899, done. remote: Compressing objects: 100% (1322/1322), done. remote: Total 5746 (delta 4099), reused 5413 (delta 3770) Receiving objects: 100% (5746/5746), 3.78 MiB | 853 KiB/s, done. Resolving deltas: 100% (4099/4099), completed with 98 local objects. From git://github.com/gitblit/gitblit  * [new branch]      bootstrap  -> origin/bootstrap  * [new branch]      gh-pages   -> origin/gh-pages  * [new branch]      issues     -> origin/issues  * [new branch]      ldap       -> origin/ldap    8f73a7c..67d4f89  master     -> origin/master  * [new branch]      rpc        -> origin/rpc From git://github.com/gitblit/gitblit  * [new tag]         v0.9.1 ...

Broken Snapshots in Java Builds

Recently I've done a lot of thinking about build tools, especially in regards to Maven, Grails and Gradle, and how they play into release management and versioning with Git. This is just a post to get some of those thoughts off my chest. I'll come back to Gradle in future posts, as I build some more experience with it at work. A few months ago, I wrote an article on our company blog about Grails' broken snapshot dependency mechanism . Even though Grails (up onto, and including Grails 2) support snapshot dependencies, the feature is flawed in a way that makes it unusable for us. This will be fixed in Grails 3, but we couldn't wait that long, so we ended up hacking together a workaround. This article describes why and how we did it. ( cont ) Now I've done a lot of modularization of huge builds over the years, and I've come to really like Maven's snapshot dependencies as an enabler for balancing between externalizing a library, and keeping it as part of th...

Github for Windows - first impressions

The other day I was listening to the recent Hanselminutes about Github for Windows  (from now on abbreviated to GhfW ), and decided to take it for a spin. I've had my pains explaining people how to set up Git on Windows, and I have pretty high hopes for this tool making it easier. Dude, where's the frame.. At first I was a bit unsure if it was actually running, and not some popup on the current webpage: Metro style lack of frame around the application This is the first Metro style application I've installed, I think. And it didn't take long to like the feel of the application, cause it feels light, smooth and fast. I heard that GhfW can be a real memory hog, but I can't really confirm that here. It starts off taking 50 megs, and then later grows to 120 with a few repos checked out. At the end of writing this blog post it's at 200 megs. But I already have Git set up Now, my Windows is already set up to use Git, so I was a bit surprised to see that af...

My Git Setup on Windows

This is kind of a continuation of my earlier post about my terminal/shell on OS X and Linux . As I was recently preparing for my Git on Windows talk , I naturally started tweaking the setup on Windows as well in the same direction, and I figured I'd share this setup. Installing Git Either go with Git for Windows , or Git Extensions if you want more GUI as well as Visual Studio integration. I personally have grown a distaste for TortoiseGit , as it sometimes locks files in my repositories. But it's supposed to be good otherwise (as an alternative for Git Extensions). Git Extensions During the Git install, you need to select the scary red option , for integrating Git into Windows cmd-line, if you want to use it from Powershell/Console2 (we'll get back to that later). The cygwin-like Git Bash is not sexy. Update (30/4 2012) :  I think you could also  wrap Console2 around Cygwin , although I haven't tried this myself yet. This way you can avoid the scary ...

Trying again: Presenting Git on Windows at Bonn-to-Code.net

I have written this blog post before ! Regardless, this talk, which was cancelled last year, is now back on track for the 24th of April. The rest of this post is basically a copy of the old one, with a few minor updates: It's been a while since I ran Visual Studio on my laptop. In my early university-college days, around ten years ago,  .NET  was just coming out of the oven. We learned algorithms and data-structures doing Java, but when it came down to actual application development, desktop- and web, connecting GUI's with databases, .NET was the thing. I liked it. It was bit of an eye-opener for me, that I could actually use programming for building useful stuff, and not just fantasize about being a game developer. Later on, I fell back into the Java/J2EE world, and rode there for a while. While working for  Objectware 's Java department, it was always interesting to see what the .NET department was up to, and while they were part of them evil scheme of Microsoft...

My terminal/shell

Just a quick post about what my terminal looks like these days. Some things I value in my terminal: Good looking/easy on the eyes (using color-theme solarized )  Being able to bootstrap my setup fairly quickly on new machines Portable setup between OSX/ iterm2 (at work) and Ubuntu Terminal (at home) Good git support I strap the boot by cloning my prefs (collection of my environment/config files) into my home-dir (I still have to manually install zsh at some point): git clone git://gitorious.org/testing-git/prefs.git And then "deploy" the config files into my environment: cd prefs ./deploy.sh Now I could've probably used puppet for boostrapping this on new machines, but so far I've managed with just a little deploy.sh that copies the files into the right places, and a reverse-deploy.sh that copies them back into my  prefs  dir after I have played around with making changes locally. I use zsh , assisted heavily by the  oh-my...

Git-SVN mirror product: SubGit

Just a quick mention for you people who can't be bothered with my somewhat intricate Git-SVN mirror setup , there now is a now is a solution packed into a product: SubGit . I tried it out on a little local SVN repo recently, and it worked just fine. It delivered pretty much perfect two-way syncing/bi-directional mirror (which I've earlier deemed to be very impractical with git-svn ). The bad parts are: It's new (use at your own risk, in other words: DO NOT install it in your main-line subversion repo used by a 100 devs). It's closed source, so you're at the mercy of the SubGit devs for fixing any feature that you need in your special repository.  It requires instrumentation on the Subversion repository installation. If the repository is beyond your control (hosted externally, or by some separate department), you're stuck with my old setup . The good parts: Super-sweet functionality! I mean, bi-directional Git/SVN is highly sought after. Seems to...