Posts for: #Git

git-vim hacking

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.

Read more →

how old are these files in git?

A freind asked me how he could check the age of a file in his git repository. I came up with this:

    % git ls-files | xargs -n1 -i{} git log -1 --pretty=format:"%ci {}" -- {}
    2007-04-11 11:39:31 -0400 .gitignore
    2008-10-18 10:52:27 -0400 Xdefaults
    ...

It walks through all the files tracked by git and prints the time stamp of the last commit that modified that file.

Git rocks!

Read more →

splitting patches with git

Here is a really cool workflow using git…

Say you have several commits (you can think of them as patches for this exercise) in your current repository and want to split one into multiple parts. There could be various reaons like upstream request, only want to release part of it, remove debug code, etc.

Anyway, there is one commit in your unpublished history that needs to be split.

Read more →

git-svn strangeness

As awesome as git-svn is, I had it fail today with this message:

    Last fetched revision of refs/remotes/branches/foo was r19307, but we are about to fetch: r19307!

To which I said: “WTF?”. I still don’t know what it means, but I can share with you how I recovered it.

It turns out that git-svn is quite capable of recovering from this. You just have to remove its meta-data for the offending branch, and resync with SVN.

Read more →

installing git man pages quickly

I just upgraded git to get a fix for a diff buffer overflow. I built the git binaries, but this box is too slow to rebuild the man pages.

Fortunately those are already prebuilt in a separate branch. One way to install them without rebuilding them locally is to:

    # in a clone of git://git.kernel.org/pub/scm/git/git.git
    
    git archive --format=tar origin/man | sudo tar -x -C /usr/share/man/ -vf -

… with which I don’t have to rebuild man pages locally. Git rocks!

Read more →