Re: Additional git conversion steps - Mailing list pgsql-hackers

From Christopher Browne
Subject Re: Additional git conversion steps
Date
Msg-id AANLkTinDWY5H+a5C09RGzVXcarPx6JJdAjqa6V70BPzt@mail.gmail.com
Whole thread Raw
In response to Additional git conversion steps  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Tue, Aug 17, 2010 at 2:21 PM, Tom Lane <tgl@sss.pgh.pa.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


pgsql-hackers by date:

Previous
From: Magnus Hagander
Date:
Subject: Re: git: uh-oh
Next
From: Robert Haas
Date:
Subject: Re: git: uh-oh