Re: Add .gitignore files to CVS? - Mailing list pgsql-hackers

From Kevin Grittner
Subject Re: Add .gitignore files to CVS?
Date
Msg-id 4B4C50A0020000250002E2A2@gw.wicourts.gov
Whole thread Raw
In response to Re: Add .gitignore files to CVS?  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Add .gitignore files to CVS?  ("Kevin Grittner" <Kevin.Grittner@wicourts.gov>)
List pgsql-hackers
Robert Haas <robertmhaas@gmail.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

pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Typed tables
Next
From: "Joshua D. Drake"
Date:
Subject: Re: mailing list archiver chewing patches