Upgrading Git on Mac OS X 5

Posted by Colin A. Bartlett Sat, 07 Mar 2009 13:11:00 GMT

We recently switched to git based capistrano deployments and I quickly found out that these weren’t working from my MacBook Pro. I noticed that my git version was a few behind my coworker’s, so I figured it was time to upgrade.

Following Justin’s original git compilation instructions, I downloaded and compiled the latest Git version, 1.6.2 like so:

curl -O http://kernel.org/pub/software/scm/git/git-1.6.2.tar.gz
tar jxvf git-1.6.2.tar.gz
cd git-1.6.2
make prefix=/usr/local all
make prefix=/usr/local test && echo $?
sudo make prefix=/usr/local install

When the compile was done, it gave me output like this:

!! You have installed git-* commands to new gitexecdir.
!! Old version git-* commands still remain in bindir.
!! Mixing two versions of Git will lead to problems.
!! Please remove old version commands in bindir now.

Thanks to this nice posting, I discovered this always happens when you upgrade to 1.6 and above. Git now only puts the main git binary and a few others in your /usr/local/bin and it tucks the rest away elsewhere. That meant that all the other zillion binaries needed to be deleted from my bin. I simply did:

cd /usr/local/bin/
ls -latr | grep git

Which gave me an ordered list of all the git binaries installed. The ones at the end all had today’s date on them, so I knew those were the new versions. The rest I could whack. The ones I could keep were git-upload-pack, git-upload-archive, git-receive-pack, git, git-shell, git-cvsserver, and gitk. The rest I removed like so:

sudo rm git-var git-update-server-info git-unpack-file git-ssh-upload git-ssh-push git-ssh-pull git-ssh-fetch git-show-index git-send-pack git-peek-remote git-patch-id git-pack-redundant git-mktree git-mktag git-merge-tree git-merge-recursive git-merge-index git-local-fetch git-index-pack git-imap-send git-http-push git-http-fetch git-hash-object git-fetch-pack git-fast-import git-daemon git-convert-objects git-bisect git-write-tree git-whatchanged git-verify-tag git-verify-pack git-update-ref git-update-index git-unpack-objects git-tar-tree git-tag git-symbolic-ref git-svnimport git-svn git-submodule git-stripspace git-status git-stash git-show-ref git-show-branch git-show git-shortlog git-sh-setup git-send-email git-runstatus git-rm git-revert git-rev-parse git-rev-list git-reset git-rerere git-request-pull git-repo-config git-repack git-remote git-relink git-reflog git-rebase--interactive git-rebase git-read-tree git-quiltimport git-push git-pull git-prune-packed git-prune git-parse-remote git-pack-refs git-pack-objects git-name-rev git-mv git-mergetool git-merge-subtree git-merge-stupid git-merge-resolve git-merge-ours git-merge-one-file git-merge-octopus git-merge-file git-merge-base git-merge git-mailsplit git-mailinfo git-ls-tree git-ls-remote git-ls-files git-lost-found git-log git-instaweb git-init-db git-init git-gui git-grep git-get-tar-commit-id git-gc git-fsck-objects git-fsck git-format-patch git-for-each-ref git-fmt-merge-msg git-filter-branch git-fetch--tool git-fetch git-diff-tree git-diff-index git-diff-files git-diff git-describe git-cvsimport git-cvsexportcommit git-count-objects git-config git-commit-tree git-commit git-clone git-clean git-citool git-cherry-pick git-cherry git-checkout-index git-checkout git-check-ref-format git-check-attr git-cat-file git-bundle git-branch git-blame git-archive git-archimport git-apply git-annotate git-am git-add--interactive git-add gitjour

Then I just had to go back and install the manpages for the new version like so:

curl -O http://kernel.org/pub/software/scm/git/git-manpages-1.6.2.tar.bz2
sudo tar xjv -C /usr/local/man -f git-manpages-1.6.2.tar.bz2

And, low and behold, I was now running git 1.6.2! What’s more, my capistrano deployments work now.

Compiling Emacs.app and Tips 1

Posted by Justin Reagor Thu, 18 Dec 2008 03:08:00 GMT

I’d like to start by thanking Mr. Peepcode for his article which presented a great case for learning Emacs! Without it, I would have never thought of mastering the only Unix editor I had yet to experience.

Configure With NS

GNU is NeXTstep Unix… why even bother with Aqua, Carbon, Cocoa Emacs when you can just compile “nextstep” support for GNU Emacs itself?

NOTE: I used another blog article but it seems like its always incredibly slow. Check that guy’s blog out since he’s the original author though, or buy him a beer.

So here are the regurgitated compilation steps that I used.

git clone git://repo.or.cz/emacs.git
cd emacs/
./configure --with-ns
make
make install
sudo cp -R ./nextstep/Emacs.app ~/Applications

Configuration Tips

If your a picky hacker like myself you’ll be customizing your workspace for the rest of your life… but you’ll want to definitely clone topfunky’s emacs-starter-kit. It takes some configuration to get right, but puts you on a great start. I loaded linum-mode, ruby-electric and some radical themes to get comfortable. Also, I can’t keep away from RTFM too.

One final thing to note, I read that although nxhtml looks pretty friggin awesome… its a monster to load. I patched these lines to my starter-kit-misc.el as well… to use the nxml library in which nxhtml was built upon. Its gotta be smaller, faster and cleaner then all of those features I just won’t be using in nxhtml.

(add-to-list 'auto-mode-alist '("\\.html$" . nxml-mode))
(add-to-list 'auto-mode-alist '("\\.rhtml$" . nxml-mode))

If and when I get back around to adding syntax highlighting to the Ruby lines within erb/rhtml files (which nxml modes loads into now)... I’ll need to patch those lines up again to load Rinari’s “rhtml-mode” or what have you. You can remove just the rhtml mode from Rinari by the way.

Of course I haven’t yet decided if I want to use emacs-rails, Rinari, or just stick with Yasnippets by itself ::shrug::. I’m fine typing out my code right now while I get the hang of my workflow with Emacs, but if anyone has any experience with them please comment your thoughts.

Textmate ;_;

So yeah, TextMate is now officially dead to me. I wish it wasn’t so, but with all the amazing support of Emacs, the power and fun of Lisp and the focus of staying on the keyboard the entire day… I’m pretty sure I won’t go back.

Flushing OS X DNS cache

Posted by Colin A. Bartlett Mon, 10 Dec 2007 16:39:00 GMT

I don’t know why it took me so long to learn this but this command is very handy:
dscacheutil -flushcache

update: I originally posted that the command was dnscacheutil. It’s actually just dscacheutil. I’ve fixed it above. I also learned this is a Leopard-only tool.

It’s equivelant to the following Windows, which was always very handy when changing DNS configuration around:

ipconfig /flushdns

Time Machine is Awesome 1

Posted by Colin A. Bartlett Sun, 18 Nov 2007 20:51:00 GMT

Nothing more to say.

It just rocks. So easy to setup. So easy to use.

Once again, Apple, I bow before thee.

Compiling Git for Mac OS X Leopard (10.5) 2

Posted by Justin Reagor Wed, 31 Oct 2007 03:48:00 GMT

The following is the exact compilation steps I took for compiling Git onto the new retail version of Leopard. Definitely a big change since my previous article on installing in Tiger (next to pre-installed SVN, bye bye CVS!)...

Commands
curl -O http://surfnet.dl.sourceforge.net/sourceforge/expat/expat-2.0.1.tar.gz
tar zxvf expat-2.0.1.tar.gz 
cd expat-2.0.1
./configure --prefix=/usr/local
make
make check
sudo make install
cd ..

curl -O http://kernel.org/pub/software/scm/git/git-1.5.3.4.tar.bz2
tar jxvf git-1.5.3.4.tar.bz2
cd git-1.5.3.4
make prefix=/usr/local all
make prefix=/usr/local test && echo $?
sudo make prefix=/usr/local install
cd ..

curl -O http://www.kernel.org/pub/software/scm/git/git-manpages-1.5.3.4.tar.bz2
sudo tar xjv -C /usr/local/man -f git-manpages-1.5.3.4.tar.bz2

Notes

You may need to adjust your default MANPATH environment variable. You can either apply something along the lines of…

export MANPATH="/usr/local/man:$MANPATH"

...to your .bash_login, profile or what have you. Or you can look into editing /private/etc/man.conf (or un-tar the manpages into a directory in your MANPATH already).

Also, no need to fiddle around with SVN bindings for Perl, or whatever the problem was with git-svn before.

You may also wish to surf our past articles hear on this blog for upgrading Git. The upgrading should be identical on Leopard.

Next Time

My next article will cover developing outside of a traditional distributed Git environment. Using Git to manage personal branching/merging/local copies, then committing to a main SVN repo. Happy hacking.

Here goes nothing...

Posted by Colin A. Bartlett Sat, 27 Oct 2007 00:51:00 GMT

I’ve got the Leopard t-shirt on and I’m ready to go!

Update!

Install complete! Took exactly 60 mins.

Reactions:

  • The installer ‘estimated time to completion’ said 2 hours and 58 minutes at first. It steadily declined but was never accurate at all. Oh well.
  • First boot up took for freaking-ever. To be expected, I guess.
  • My wireless seems finicky. Could just be my access point or something. I hope so. Because I kept loosing and regaining internet access. I’m plugged into wired now and it seems fine. Hopefully it’s not a bug or anything…
  • My CPU is churning hard core. Something called ‘mds’ is sucking it up. A web search shows that’s Spotlight. So maybe just a reindex.

But the most important news…

The rails stack seems to be functioning fine. Ruby 1.8.6 and everything. Got an app running; no problems.

So far so good! I can’t wait to try out the new Mail. It looks good enough to maybe switch to from Thunderbird.

Older posts: 1 2