Git

More on Git patches

Posted on April 18th, 2011 by David Luhman and tagged .

This is a quick follow-on to my earlier post on Git patches.

Here's a quick summary of what I found in the following post :

DIFFS IN PATCH : git apply --stat /tmp/patches/install.patch
CHECK IF APPLIES : git apply --check /tmp/patches/install.patch
APPLY PATCH : git apply /tmp/patches/install.patch

http://ariejan.net/2009/10/26/how-to-create-and-apply-a-patch-with-git/

Find newly added files with Git

Posted on March 8th, 2011 by David Luhman and tagged .

OK, this is a stupid one-liner, but it works.

Here's how to find newly added files to a Git repository :

git whatchanged | grep : | grep ' A' | grep -v Author: | grep -v Date: | grep \.\.\. | more

:000000 100644 0000000... 89fd0d4... A tests/f1.php
:000000 100755 0000000... c430e79... A tests/f2.php
:000000 100755 0000000... 130edda... A tests/f3.php
:000000 100644 0000000... 0f395e9... A tests/f4.php
.
.
.

See this quick reference :

http://superuser.com/questions/117626/find-recently-added-files-with-git

Maintaining Drupal with fake Git submodules

Posted on October 29th, 2010 by David Luhman and tagged , .

With Drupal moving to the Git version control system, I'm looking at refining a good way to install, update, and customize Drupal installations using Git.

Since Drupal core, modules, and themes will be separate Git repositories, it seems like using Git submodules, or subtrees are worth looking into for module and theme management.

Upgrading Drupal 6 to Drupal 7 Using Git

Posted on October 13th, 2010 by David Luhman and tagged , , , .

The Drupal UPGRADE.txt file and upgrade handbook page provide a lot of good information and procedures to perform a major upgrade (ex. 6.x => 7.x).

However, if you're looking to manage your Drupal 7 installation using Git, the upgrade guides don't provide Git-specific advice.

Here's a procedure I found useful when upgrading Drupal 6 to Drupal 7 using Git.

First, clone the Drupal 7 git repository using this :


git clone git://github.com/drupal/drupal.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.php
  $ git commit -m "Removing a file"

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

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.php
  $ 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