serving http content out of a git repo
[ link: http-out-of-git | tags: git web lighttpd | updated: Sat, 27 Feb 2010 10:37:08 ]
While preparing for my Git Workshop for Flourish Conf, I thought about serving files over http directly out of a git repo.
Here is a short shell script that I came up with: git-serv.cgi.
It takes request URLs like http://domain/examples/dir/file and looks up the
objects in a bare git repository in /home/git/examples.git. It looks only on
the master branch, and nothing is ever checked out. If it finds a tree
object, it prints the file listing at that point in the tree. If the object is
a blog, it dumps the contents. Otherwise some error is reported.
The other way to achieve something similar would be to use a hook script, like what I used with my resume post-update hook.
pimped out zsh prompt
[ link: pimping-out-zsh-prompt | tags: git zsh shell | updated: Thu, 25 Feb 2010 11:11:38 ]
Here is yet another update to the series. I've updated my git prompt again,
now using the zsh 4.3.7 built in vcs_info module. This time the motivation came
from Zsh Prompt Magic article.
Here is what it looks like now:

Everything is now self contained in one file: S60_prompt. Grab it and source it into your zsh config.
The features are:
- name of current branch,
- git repo state (
rebase,am,bisect,merge, etc), - markers indicating staged/unstaged changes,
- little
1after branch name indicates dirty working tree, - little
2after branch name indicates staged changes,
- little
- highlight depth decended into the repository on the right,
- show failure of commands via prompt background change,
- show command/insert mode when using vi mode (
set -o vi).
using WIP branches to save every edit
[ link: save-everything-with-git-wip | tags: git vim | updated: Fri, 15 Jan 2010 22:27:56 ]
I am experimenting with a new workflow to help solve the problem of lost work between commits. As described in my previous post, there are already several ways to deal with keeping track of frequent edits. The only problem is that they all involve dedication and extra effort.
using git workflows to avoid loosing intermediate changes
[ link: 20091104194146 | tags: git | updated: Fri, 15 Jan 2010 22:27:56 ]
A few days ago a buddy, Jean, had stumbled into a problem caused by infrequent committing to his git repository. Committing after the feature is implemented is common when working with tools like SVN... but we have multiple workflows available to us under git to manage frequent commits.
pimping out git log
[ link: pimping-out-git-log | tags: git | updated: Mon, 22 Feb 2010 09:34:24 ]
I got playing with git log and ended up creating this alias:
[alias]
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative
Which adds a git lg command that is a prettier version of git log --oneline.
importing an old project into git
[ link: 20090714094340 | tags: git | updated: Fri, 15 Jan 2010 22:27:56 ]
I have recently been asked to revive an old project. Way back when I used to use bk for tracking changes. But today, I don't even have a working bk tree.
Moving the history to git is easiest done by taking the tarballs I've published and creating a commit per tarball.
Below is a simple script that will do just that.
Why pick Git?
[ link: why-pick-git | tags: git | updated: Fri, 15 Jan 2010 22:27:56 ]
Someone on the Git LinkedIn group asked "why pick Git?". I started writing a response on LinkedIn but quickly realized I had more to say on the topic than I'd care to leave behind closed doors of LinkedIn.
If you already use Git, none of the stuff I talk about below will surprise you. But if this sparks your interest see my Git talk.
bringing git-format-patch to bzr
[ link: 20090622214023 | tags: git bzr | updated: Fri, 15 Jan 2010 22:27:56 ]
It should be of no surprise to readers of this blog that I am a fan of Git. If you know me, you will also know that I am no fan of Bzr.
I was working on something today and wanted to export a patch... you know, like git format-patch does.
Well, bzr does not seem to have an equivalent.
Scott Chacon smacks git around
[ link: 20090610202041 | tags: git | updated: Fri, 15 Jan 2010 22:27:56 ]
I came across a RailsConf talk given by Scott Chacon last month. As previously, his git work is really good. His presentation style has also guided my Git the basics talk which I gave about a year ago.
Anyway, I want to summarize what I learned from Scott's presentation...
git-vim hacking
[ link: 20090608010405 | tags: git vim vimgit | updated: Fri, 15 Jan 2010 22:27:56 ]
I did some hacking on my fork on git-vim. I am impressed how well things work. motemen, the upstream author, did a really great job setting things up.
I've been mostly tyoing with command handling and completion this evening.
I want to make that I could type :git diff ma<tab> and have it do the
rigth thing... it seems to work.
Next, I need to integrate my other git hacks and also others that seem interesting. I should also see if I can get the upstream author to consider including any of it.
