Re: Additional git conversion steps

From: Christopher Browne <cbbrowne(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Additional git conversion steps
Date: 2010-08-17 19:26:33
Message-ID: AANLkTinDWY5H+a5C09RGzVXcarPx6JJdAjqa6V70BPzt@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Aug 17, 2010 at 2:21 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> There are a couple of things I think should happen ASAP once the git
> repository is up, but weren't mentioned in Magnus' plans:
>
> 1. The various .cvsignore files need to be replaced by .gitignore files.
> I am not sure though whether this is a trivial conversion --- does git
> have similar default rules about ignoring .o, etc?

Certainly, with two variations:

1. If you don't want to hear about *.rej or *.orig files, you could
put relevant patterns into $GIT_DIR/.git/info/exclude

That's not checked in - that's configuration for one particular repo,
and that repo alone.

2. You can create a .gitignore file in any directory, and check it
in; it'll indicate patterns to ignore in this directory and those
below.

So, you'd presumably do something like:
echo "*.o" >> $GIT_DIR/.gitignore
to deal with .o files
echo "*~" >> $GIT_DIR/.gitignore
so Emacs deteriorata gets ignored
and some other set of additions for typical "cruft" that is normally
safe to ignore.

The existing .cvsignore files can simply get renamed to .gitignore,
and that'll just work.

I had the entertaining case where, with Slony-I, I did, within the same commit:
git rm .cvsignore
git add .gitignore
(where I had copied data from one to the other)
and discovered that Git discovered that this was actually a "mv" request.

I frequently find myself doing a build of things, and then running:
git status > .gitignore
which stows *all* the generated files, commented, so that they aren't
yet ignored.

Then, edit .gitignore, stripping off leading # for things that should
be ignored, and drop out anything that shouldn't be ignored.

git commit .gitignore -m "Populate all generated files that should be
ignored by Git"

This is one of the first things worth committing once Git gets turned on.
--
http://linuxfinances.info/info/linuxdistributions.html

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2010-08-17 19:28:46 Re: git: uh-oh
Previous Message Magnus Hagander 2010-08-17 19:23:04 Re: git: uh-oh