HowTo: Using -lite with a GIT-based application

Years ago while looking for a fast init replacement for work, I found Finit. Originally written by Claudio Matsuoka to act as a drop-in replacement for the Asus EeePC fastinit, “gaps filled with frog DNA …“

Until I found Finit I had always been in awe of those venturing into the realm of PID 1. However, learning from the simplicity of Claudio’s code I realized that although PID 1 at times is indistinguishable from magic, it is really not that hard to master. My version of Finit is available on GitHub.

The code is open sourced under the very liberal MIT/X11 license, and much of its frog DNA has proven very useful to me over the years. This blog post is about how that frog DNA can help you fill gaps in your projects …

[Read More]

HowTo: Push to multiple GIT repos with one command

So, now that I have http://git.troglobit.com setup as a backup GIT repo to https://github.com/troglobit, I needed a simple way to always push to both repos – best way for me is to always hook into my regular work flow, otherwise I’d just forget. The git-remote(1) man page to the rescue, it describes the set-url --add sub-command:

git remote set-url --add origin ssh://git.troglobit.com:1234/srv/git/watchdogd.git

Now, with a simple git push followed by git push --tags I had now pushed to both the GitHub repo as well as my own server!

[Read More]

HowTo: Apache with Gitweb on Debian 8.1

I’m posting this in case anyone else gets stuck setting up Apache with Gitweb. Also as a reminder to myself in case I ever need to set up this all over again.

  1. You have all your eggs in one basket (GitHub), and
  2. You really like that shiny basket, but
  3. You know you’re clumsy and usually drop baskets yourself.
  4. You are wise (yes you are!) and realize you need another basket, so
  5. You set up a server and a domain yourself …

OK. Let’s start simple, since you are already running the latest Debian you fire up the command line and install the basics:

sudo apt-get install gitweb apache2

So it’ll complain, you’ll clarify your request and soon all required packages are on your server. Now what?

Debian has already set up http://localhost/gitweb for you, and if you have a domain already you should go ahead and edit the master file for that:

editor /etc/apache2/sites-available/000-default.conf
service apache2 reload

If you want to use that for your gitweb needs, then you’re done!

[Read More]

Blog Restoration Project

I’ve had this long-standing issue with backups. It’s deadly boring to set up and maintain, so I don’t do any. Until today!

Today I moved the sources for my Octopress blag to GitHub, which also prompted me to set up a mirror on GitHub Pages. As usual, reading up on the subject and muster enough motivation took me about three months, whereas the actual work took about 4h.

[Read More]

HowTo Rebase without an origin

OK, so you’ve just been handed the task to integrate a big piece of corporate software and it’s nowhere near as done and ready as project management thinks. Of course you’ve already started chugging away at it, fixing bugs, refactoring code and wrapping it in neat containers to keep the changeset against the base SW small – you already know you’ll get another drop of the same stinking pieace of code in another six months, so you keep the changes small and track them in GIT with neatly formatted commit messages. [Read More]

HowTo Rebase without an origin

OK, so you’ve just been handed the task to integrate a big piece of corporate software and it’s nowhere near as done and ready as project management thinks. Of course you’ve already started chugging away at it, fixing bugs, refactoring code and wrapping it in neat containers to keep the changeset against the base SW small – you already know you’ll get another drop of the same stinking pieace of code in another six months, so you keep the changes small and track them in GIT with neatly formatted commit messages. [Read More]

Git Quickie

This is a document I intend to maintain for my own purposes. It serves as a quick reminder for the steps needed when creating and working with git repositories. First setup a bare repository on the server. $ git --bare init projectX.git Initialized empty Git repository in /pub/git/projectX.git/ Set one-liner description, visible in gitweb. $ echo "Secret project, use ROT13 to decode source code" >projectX.git/description Set up a post-update hook so that the server repo is update automatically when you push to it. [Read More]

Converting from Bazaar to GIT

You need git, and bazaar obviously. Also install bzr-fastimport, it contains the export plugin as well. The rest is a rip off from Frank’s page. $ git init project.git $ cd project.git $ bzr fast-export --export-marks=.git/bzr.mark ~/project.bzr | git fast-import --export-marks=.git/git.mark That worked for me. The output will likely be something like this: 01:41:19 Calculating the revisions to include ... 01:41:19 Starting export of 33 revisions ... 01:41:20 Exported 33 revisions in 0:00:01 git-fast-import statistics: --------------------------------------------------------------------- Alloc'd objects: 5000 Total objects : 267 ( 0 duplicates ) blobs : 158 ( 0 duplicates 57 deltas) trees : 76 ( 0 duplicates 55 deltas) commits: 33 ( 0 duplicates 0 deltas) tags : 0 ( 0 duplicates 0 deltas) Total branches : 10 ( 1 loads ) marks : 1024 ( 33 unique ) atoms : 38 Memory total : 2344 KiB pools : 2110 KiB objects: 234 KiB --------------------------------------------------------------------- pack_report: getpagesize() = 4096 pack_report: core. [Read More]

HowTo use Git for Collaborative Development

This is mainly some notes for myself so I don’t forget. Having worked with GNU Bazaar before much of Git is still alien to me. This HowTo is divided into two parts: what happens on your laptop, and what you must do on a remote server where you publish your changes So, let’s start stimple: laptop> mkdir projectX; cd projectX laptop> git init laptop> emacs file1.txt laptop> git add file1. [Read More]