Thread: Patch to .gitignore

Patch to .gitignore

From
Fabrízio de Royes Mello
Date:
Hi all,

The proposed patch add some files to ignore in .gitignore:
- tags (produced by src/tools/make_ctags)
- TAGS (produced bu src/tools/make_etags)
- .*.swp (may appear in source tree if vi/vim was killed by some reason)

Regards,

--
Fabrízio de Royes Mello
Consultoria/Coaching PostgreSQL
>> Blog sobre TI: http://fabriziomello.blogspot.com
>> Perfil Linkedin: http://br.linkedin.com/in/fabriziomello
>> Twitter: http://twitter.com/fabriziomello
Attachment

Re: Patch to .gitignore

From
Christopher Browne
Date:
There hasn't been general agreement on the merits of particular .gitignore rules of this sort.

You could hide your own favorite patterns by putting this into your ~/.gitignore that isn't part of the repo, configuring this globally, thus:
git config --global core.excludesfile '~/.gitignore'

That has the consequence that you can hide whatever things your own tools like to create, and not worry about others' preferences.

Us Emacs users can put things like *~, #*#, and such into our own "ignore" configuration; that doesn't need to bother you, and vice-versa for your vim-oriented patterns.

Re: Patch to .gitignore

From
Fabrízio de Royes Mello
Date:

On Fri, May 24, 2013 at 12:04 AM, Christopher Browne <cbbrowne@gmail.com> wrote:
There hasn't been general agreement on the merits of particular .gitignore rules of this sort.

You could hide your own favorite patterns by putting this into your ~/.gitignore that isn't part of the repo, configuring this globally, thus:
git config --global core.excludesfile '~/.gitignore'


Yes... I know that...
 
That has the consequence that you can hide whatever things your own tools like to create, and not worry about others' preferences.

Us Emacs users can put things like *~, #*#, and such into our own "ignore" configuration; that doesn't need to bother you, and vice-versa for your vim-oriented patterns.

I agree with you about vim-oriented patterns, because its a particular tool, but "ctags" and "etags" be part of postgres source tree and its generate some output inside them, so I think we must ignore it. 

IMHO all output generated by tools inside the source tree that will not be committed must be added to .gitignore

Regards,

--
Fabrízio de Royes Mello
Consultoria/Coaching PostgreSQL
>> Blog sobre TI: http://fabriziomello.blogspot.com
>> Perfil Linkedin: http://br.linkedin.com/in/fabriziomello
>> Twitter: http://twitter.com/fabriziomello

Re: Patch to .gitignore

From
amul sul
Date:
 >"ctags" and "etags" be part of postgres source tree and its generate some output inside them, so I think we must
ignoreit.  

+1


Regards,
Amul Sul



Re: Patch to .gitignore

From
Tom Lane
Date:
Fabrízio de Royes Mello <fabriziomello@gmail.com> writes:
> On Fri, May 24, 2013 at 12:04 AM, Christopher Browne <cbbrowne@gmail.com>wrote:
>> There hasn't been general agreement on the merits of particular .gitignore
>> rules of this sort.

> I agree with you about vim-oriented patterns, because its a particular
> tool, but "ctags" and "etags" be part of postgres source tree and its
> generate some output inside them, so I think we must ignore it.

[ shrug... ]  Editor backup files get generated inside the source tree
as well.  Chris stated the policy accurately: if you use tools that
leave unexpected files in the source tree, it's up to you to have a
personal .gitignore for those, assuming you want them ignored.  The
project's .gitignore files are only supposed to list files that get
generated by the standard build processes.

FWIW, my personal .gitexclude file looks like

*~
*.orig

where the latter one is for junk generated by "patch".  I believe
patch's extension for saved files varies across versions, so it
wouldn't be too sensible to have an exclusion like that in the
project-wide file.  Note also that I intentionally *don't* have an
exclusion for *.rej --- if any patch hunk failed, I want git to
mention it.  But that's a matter of personal preference.  I rather
imagine that other people configure it differently, and that's fine.
As long as we don't try to put such things in the project-wide
exclusion list, we don't have to have a consensus about it.
        regards, tom lane



Re: Patch to .gitignore

From
Dimitri Fontaine
Date:
Christopher Browne <cbbrowne@gmail.com> writes:
> You could hide your own favorite patterns by putting this into your
> ~/.gitignore that isn't part of the repo, configuring this globally, thus:
> git config --global core.excludesfile '~/.gitignore'

You can also put per-project setup in .git/info/exclude, works well.

> Us Emacs users can put things like *~, #*#, and such into our own "ignore"
> configuration; that doesn't need to bother you, and vice-versa for your
> vim-oriented patterns.

You can also ask Emacs (or any other editor I'm sure) to move its backup
files out of the way. I'm using the following, for example:
 (setq backup-directory-alist '((".*" . "~/.emacs.d/backups/")))

Regards,
-- 
Dimitri Fontaine
http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support