Re: Add .gitignore files to CVS?

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Robert Haas" <robertmhaas(at)gmail(dot)com>, "Peter Eisentraut" <peter_e(at)gmx(dot)net>
Cc: "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>, "Alex Hunsaker" <badalex(at)gmail(dot)com>, "Magnus Hagander" <magnus(at)hagander(dot)net>, "Tim Bunce" <Tim(dot)Bunce(at)pobox(dot)com>, "pgsql-hackers" <pgsql-hackers(at)postgresql(dot)org>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Add .gitignore files to CVS?
Date: 2010-01-12 16:36:16
Message-ID: 4B4C50A0020000250002E2A2@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Robert Haas <robertmhaas(at)gmail(dot)com> wrote:

> What I'm interested in is being able to run 'git status' on a tree
> in which I've run a build without getting a lot of extra output,
> and that will require ignoring all the build products.

If you prefer to keep it all in one directory tree, something like
the following would work on Linux. (The first of the two statements
would probably need a slight tweak to work on other *nix, but I'm
not sure of the best format.)

echo '# Globally ignore common build product patterns.

*.[oa]
*.so
*.so.*

# Ignore specific files.
' > .gitignore
git status | grep '^#[^ ]' | sed -e 's/#\t//' \
-e '/^[^\/][^\/]*$/ s/^/\//' >> .gitignore

If you run that right after branching and building, you should be
set. It produces the attached for me, which seems to work. For me,
at least. On kubuntu.

If we included and maintained the attached file in the repository,
it'd save running the above. That seems reasonable to me, but I
don't care enough to argue over it.

-Kevin

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Joshua D. Drake 2010-01-12 16:38:00 Re: mailing list archiver chewing patches
Previous Message Peter Eisentraut 2010-01-12 15:54:57 Re: Typed tables