Git

Scmbug for Git/BitKeeper - Bugzilla Integration

Posted on August 24th, 2010 by David Luhman and tagged , .

I ran across an interesting open source program called Scmbug. Scmbug is a system that integrates software configuration management with bug-tracking.

I was looking for a tool that would help with :

  • Showing what bugs are fixed in a particular build or revision control commit?
  • Automatically updating a bug tracker when bugs are completed (fixed) and approved.
  • Not allowing unapproved bugs to be committed to a given branch.

Getting "git rm" to work

Posted on August 5th, 2010 by David Luhman and tagged .

I thought I could remove files from Git pretty easily with essentially :


  $ git rm myfile.txt
  $ git commit -m "Removing a file"

But I was getting this error upon commit : "Could not open input file myfile.txt"

This is how I got it to work. The Git Cheat Sheet (http://cheat.errtheblog.com/s/git) described this as "Commit the absence of myfile.txt to the project"


  $ git rm --cached myfile.txt
  $ git commit -m "Removing a file"

Introduction to Git for Drupal

Posted on June 23rd, 2010 by David Luhman and tagged , .

Here's a PDF copy of the presentation I'll be giving at DrupalCamp Colorado in June, 2010.

Introduction to Git for Drupal

Git : fatal: unable to write new_index file

Posted on April 5th, 2010 by David Luhman and tagged .

Let's say you try the following command :

$ git status
fatal: unable to write new_index file

One cause of this that I found was that my file system had run out of space. Finding large directories with something like the following helped clean up some log files that had run wild :

$ du -h / | grep ^[0-9.]*G

Cheap PHP lint checking with Git

Posted on February 12th, 2010 by David Luhman and tagged , .

Running PHP's "built-in" lint checker (php -l) is a quick way to remove syntax errors which should never creep into your code.

However, you'll no doubt soon tire of typing "php -l" before every Git commit message, so why not let Git do the checking for you with a "pre-commit hook".

Travis Swicegood has a great article on how to set this up with Git :
http://phpadvent.org/2008/dont-commit-that-error-by-travis-swicegood

I found you could pretty much copy his pre-commit PHP script and paste it into your .git/hooks directory with a couple caveats :

Installing Hudson, Phing, PHPUnit and Git on Ubuntu

Posted on December 15th, 2009 by David Luhman and tagged , , , .

In this post, I'm just trying to get the simplest setup. I'll try to post details in a subsequent post.

Here are three posts, in descending order, on this that I found useful :

http://toptopic.wordpress.com/2009/02/26/php-and-hudson/

http://blog.jepamedia.org/2009/10/28/continuous-integration-for-php-with...

http://www.davegardner.me.uk/blog/2009/11/09/continuous-integration-for-...

First, I had to install java :

    $ sudo aptitude install sun-java6-jre  

Building Git on Red Hat-based systems

Posted on October 7th, 2009 by David Luhman and tagged .

I had a case where I had to build Git on an older Red Hat based system. Unfortunately, the system was so old that yum wasn't really supported. So I had to install the needed libraries (RPMs) "by hand" via rpm -i. There was one package that I had to update via rpm -U.

On my rather bare system, I found I had to install the following RPMs to get Git to compile :

cpp
curl
curl-devel
e2fsprogs-devel
gcc
glibc-devel
glibc-headers
glibc-kernheaders
krb5-devel
krb5-libs
make
openssl
openssl-devel
wget
zlib-devel

Git patch tutorial

Posted on September 22nd, 2009 by David Luhman and tagged .

I had some patches in one Git repository that I wanted to apply to a different repository. Here's a useful link I found on this :

http://stackoverflow.com/questions/327249/seeking-examples-of-workflow-u...

Here's what I did.

First, copy the original repository you want to get patch from. This may not be necessary in all cases, but in my case the original repository was on another machine, so this just puts everything on the same machine.

  
    $ git clone ssh://me@example.com/repos/origRepo
    $ cd origRepo

Git difftool and vimdiff

Posted on August 25th, 2009 by David Luhman and tagged .

For the most part, I use TkDiff as the Git difftool when working under X Windows. TortoiseGit also has a nice GUI diff tool for when I do occassional work on Windows.

However, when working in a Linux "terminal" environment, your Git difftool choices seem to be limited to vimdiff. This is OK, but most of the color schemes under vimdiff are terrible.

I recommend using a vimdiff friendly color scheme like "greens" which is described here :
http://www.vim.org/scripts/script.php?script_id=1253

Here's how to set yourself up to use vimdiff as Git's difftool.


Phase 4 of D-Link DNS-323 hacking - Running Optware

Posted on August 6th, 2009 by David Luhman and tagged , .

I'm using the DNS-323 primarily for automated backups, and making Git backups is part of this. The fonz fun plug (ffp) has a lot of stuff on it (rsync, lighttpd), but I didn't see Git. So I was looking to add Git via Optware.

I was able to add Optware, but the Git version couldn't clone across ssh nor rsync. Cloning across the git protocol did, however work. But I'll likely just use the rsync client to get my Git repositories. Git seems to work fine if the repo came via a plain rsync client.

root:/mnt/HD_a2/tmp# git clone ssh://root@192.168.1.108/tmp/gitTest