Additional git conversion steps

Lists: pgsql-hackers
From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgreSQL(dot)org
Subject: Additional git conversion steps
Date: 2010-08-17 18:21:42
Message-ID: 19887.1282069302@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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?

2. One thing I will miss from the removal of $PostgreSQL$ tags is that
they guaranteed that every file contained its own full pathname within
the source tree. I found myself using that an awful lot, mainly as a
source for copying-and-pasting file paths. To substitute for the tags,
I would like to propose a project standard that every file contain its
pathname in the header comment, not just the bare filename which is the
de facto standard at the moment. For example, instead of

/*-------------------------------------------------------------------------
*
* plancache.c
* Plan cache management.

we should have

/*-------------------------------------------------------------------------
*
* src/backend/utils/cache/plancache.c
* Plan cache management.

Whatever we do with the .cvsignore files will need to be back-patched
into all active branches, but I am not so anal-retentive as to wish
to back-patch the pathname comment changes.

Comments?

regards, tom lane


From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Additional git conversion steps
Date: 2010-08-17 18:29:21
Message-ID: AANLkTimu5NY_qcOUsW=FUwv5_7s2A4ioazxPXT6t_+Vx@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
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?

No, it doesn't. There are some policy decisions to be made here, too,
about what we wish to actually ignore. Personally, my preference
would be to arrange to ignore all and only *build products*, but not
things like *.rej files that CVS "helpfully" fails to mention. Also,
I think we should consider having just one .gitignore file at the top
level rather than a file in every individual directory (you can
include relative pathnames). I think that might be significantly
easier to manage.

> 2. One thing I will miss from the removal of $PostgreSQL$ tags is that
> they guaranteed that every file contained its own full pathname within
> the source tree.  I found myself using that an awful lot, mainly as a
> source for copying-and-pasting file paths.  To substitute for the tags,
> I would like to propose a project standard that every file contain its
> pathname in the header comment, not just the bare filename which is the
> de facto standard at the moment.  For example, instead of

This seems totally useless to me. However, I suppose you can do it if
it makes you happy...

> Whatever we do with the .cvsignore files will need to be back-patched
> into all active branches, but I am not so anal-retentive as to wish
> to back-patch the pathname comment changes.

Yes, we should DEFINITELY back-patch the .cvsignore stuff.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company


From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: <pgsql-hackers(at)postgreSQL(dot)org>,"Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Additional git conversion steps
Date: 2010-08-17 18:37:34
Message-ID: 4C6A909E02000025000347A1@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> 1. The various .cvsignore files need to be replaced by .gitignore
> files.

I could post my .gitignore file if you like. I'm sure it can be
improved upon by others, but it gives me a clean `git status` result
when it should. Probably better than nothing as a start.

> * src/backend/utils/cache/plancache.c
> * Plan cache management.

Sounds good to me.

-Kevin


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Additional git conversion steps
Date: 2010-08-17 18:42:25
Message-ID: 20306.1282070545@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> On Tue, Aug 17, 2010 at 2:21 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>> 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?

> No, it doesn't. There are some policy decisions to be made here, too,
> about what we wish to actually ignore. Personally, my preference
> would be to arrange to ignore all and only *build products*, but not
> things like *.rej files that CVS "helpfully" fails to mention.

My understanding of the point of an ignore file is to make sure that the
SCM doesn't decide to commit junk into the repository. So *.rej, and
editor backup files (*~) should be in the ignore files IMO. I'm not
totally clear on what CVS' default list is, though.

> Also,
> I think we should consider having just one .gitignore file at the top
> level rather than a file in every individual directory (you can
> include relative pathnames). I think that might be significantly
> easier to manage.

Well, the per-directory files are that way because CVS insists, but
we could certainly consider alternative layouts if git can do better.
I'm not convinced that one big file is better though. Can we use a
single file at the top level for policy (*.o, *.so, etc) and additional
files lower down for specific exceptions (parser/gram.c)?

regards, tom lane


From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Robert Haas" <robertmhaas(at)gmail(dot)com>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Additional git conversion steps
Date: 2010-08-17 18:46:58
Message-ID: 4C6A92D202000025000347A7@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Can we use a single file at the top level for policy (*.o, *.so,
> etc) and additional files lower down for specific exceptions
> (parser/gram.c)?

Yes.

Just as a start, done on a rather ad hoc basis, mine is attached.
If you put that at the top, current HEAD is clean, at least for
the builds I do.

-Kevin

Attachment Content-Type Size
.gitignore application/octet-stream 7.2 KB

From: Brendan Jurd <direvus(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Additional git conversion steps
Date: 2010-08-17 18:48:48
Message-ID: AANLkTi=VCiZnPOs=GG-YSoaz-vxegptH-_eGMgfeD46+@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On 18 August 2010 04:42, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> No, it doesn't.  There are some policy decisions to be made here, too,
>> about what we wish to actually ignore.  Personally, my preference
>> would be to arrange to ignore all and only *build products*, but not
>> things like *.rej files that CVS "helpfully" fails to mention.
>
> My understanding of the point of an ignore file is to make sure that the
> SCM doesn't decide to commit junk into the repository.  So *.rej, and
> editor backup files (*~) should be in the ignore files IMO.

Things are subtly different with git. git will never "decide" to add
a file to the index unless you explicitly tell it to, with `git add`.
So the idea with a .gitignore file is to tune it so that when you type
`git status` it only tells you about things that you might want to
either a) commit, or b) clean up.

With .rej files and other such items, it's nice that `git status`
pipes up about them, because it reminds you to get rid of them when
you're done hacking.

>
> Well, the per-directory files are that way because CVS insists, but
> we could certainly consider alternative layouts if git can do better.
> I'm not convinced that one big file is better though.  Can we use a
> single file at the top level for policy (*.o, *.so, etc) and additional
> files lower down for specific exceptions (parser/gram.c)?

You sure can!

Cheers,
BJ


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Additional git conversion steps
Date: 2010-08-17 18:53:36
Message-ID: 20530.1282071216@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

"Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov> writes:
> I could post my .gitignore file if you like.

Yeah, let's see it.

regards, tom lane


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
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