Archive

Posts Tagged ‘git’

core.autocrlf

October 27, 2011 Leave a comment

<rant>

I just finished tearing apart my git repo and putting it back together. The reason for this undertaking was that a number of lf/crlf EOL errors had crept into my commits somehow. The culprit, as I found out yesterday, was git config’s core.autocrlf configuration option. Initially, it was set to true, meaning that files checked out from a repo are translated from lf to crlf and files committed back in are translated from crlf back to lf. Problem is, I had some files that needed to be checked out as lf in another repository. Foolishly, I set core.autocrlf to false globally. This set in motion a set of events that led to some of my files in the paladin repo being checked in with all the line endings set to crlf. As you may guess, this absolutely destroys any chance of a meaningful review diff being produced. Clearly, this was my fault and I had to own upto it.

This is when I set out to export my commits to patches, clean up the line endings in the patches, remove any nit-picky changes ( ie a change hunk where only trailing whitespace was removed ), shove the changes back into my repo, updated the old branch pointer to look at my shiny new commits, forced github to forget my old history and finally my repo was sanitized.

What I’ve learned from this is to not let anyone or any thing handle things like line endings for me in the future as I may blow it up inadvertently while trying to do something unrelated. core.autocrlf will stay permanently set to false. The solution? My favourite text editor is now set to produce lf line endings by default; let the chips fall as they may.

</rant>

Advertisements

Gitting to Know Git…

September 22, 2011 2 comments

So I read about git and I deem git to be cool. I have prior experience with Mercurial and I’ve come to the conclusion that for all intents and purposes, git and Mercurial (hg) are roughly the same.

If you’ve never used a VCS before then git should be a pleasant learning experience. If however you’ve used something like SVN or Perforce for an extended period of time prior and have become very accustomed to the interface then git may be something of a shock for you.

In any case, try to use and enjoy it because it’s here to stay. A quick look at github’s user-base reveals a small army of over 1 million users (as of September 22, 2011). This user-base is reportedly rabid so if you don’t like git then git ready for a fight…

Successful Git Branching Model

September 15, 2011 2 comments

While looking around the #paladin wiki (https://wiki.mozilla.org/Paladin), I’ve run into this:

http://nvie.com/posts/a-successful-git-branching-model/

This link is featured on the paladin/workflow wiki page. It talks about a release/development model that center’s around Git’s cheap branches.

Now I’ve had some experience with mercurial before but I’m quite new to the Git way of “doing things” so I’m wondering, what is the typical/accepted way of “versioning” in the Git world and how different is this proposed model from what is considered mainstream?

Thank you for your attention, I apologize in advance if this post is way too newbie for consideration J