Thread: Using make_ctags leaves tags files in git

Using make_ctags leaves tags files in git

From
Steve Chavez
Date:
Hello hackers,

I use postgres/src/tools/make_ctags and it works great. But it leaves the tags files ready to be committed in git. So, I've added 'tags' to .gitignore.

Best regards,
Steve

Re: Using make_ctags leaves tags files in git

From
Michael Paquier
Date:
On Sun, May 14, 2023 at 06:13:21PM -0300, Steve Chavez wrote:
> I use postgres/src/tools/make_ctags and it works great. But it leaves the
> tags files ready to be committed in git. So, I've added 'tags' to
> .gitignore.

This has been proposed in the past, where no conclusion was reached
about whether this would be the best move (backup files from vim or
emacs are not ignored, either):
https://www.postgresql.org/message-id/CAFcNs+rG-DASXzHcecYKvAj+rmxi8CpMAgbpGpEK-mjC96F=Lg@mail.gmail.com

And there are global rules, as well.
--
Michael

Attachment

Re: Using make_ctags leaves tags files in git

From
Steve Chavez
Date:
Hello Michael,

On the previous patch:

- `.*.swp` was added, which I entirely agree shouldn't be in .gitignore as it's editor specific(despite me using vim).
- The discussion dabbled too much around the *.swp addition.

In this case I just propose adding 'tags'. I believe it's reasonable to ignore these as they're produced by make_ctags. 

Best regards,
Steve

On Sun, 14 May 2023 at 20:44, Michael Paquier <michael@paquier.xyz> wrote:
On Sun, May 14, 2023 at 06:13:21PM -0300, Steve Chavez wrote:
> I use postgres/src/tools/make_ctags and it works great. But it leaves the
> tags files ready to be committed in git. So, I've added 'tags' to
> .gitignore.

This has been proposed in the past, where no conclusion was reached
about whether this would be the best move (backup files from vim or
emacs are not ignored, either):
https://www.postgresql.org/message-id/CAFcNs+rG-DASXzHcecYKvAj+rmxi8CpMAgbpGpEK-mjC96F=Lg@mail.gmail.com

And there are global rules, as well.
--
Michael

Re: Using make_ctags leaves tags files in git

From
Tom Lane
Date:
Steve Chavez <steve@supabase.io> writes:
> In this case I just propose adding 'tags'. I believe it's reasonable to
> ignore these as they're produced by make_ctags.

Our policy on this is that the project's .gitignore files should ignore
files that are produced by our standard build scripts.  Anything else
you should put in your personal ignore patterns (one way is to set
the core.excludesFile property in ~/.gitconfig).  Otherwise it's very
very hard to argue which tools are privileged to get a project-wide
ignore entry.  Personally, for example, I use emacs but not ctags,
so I'd put "*~" way ahead of "tags".  But it's my responsibility to
ignore "*~", and I do.

            regards, tom lane



Re: Using make_ctags leaves tags files in git

From
Alvaro Herrera
Date:
On 2023-May-14, Tom Lane wrote:

> Steve Chavez <steve@supabase.io> writes:
> > In this case I just propose adding 'tags'. I believe it's reasonable to
> > ignore these as they're produced by make_ctags.
> 
> Our policy on this is that the project's .gitignore files should ignore
> files that are produced by our standard build scripts.

But make_ctags is *our* script, so I think this rule applies to them as
well.  (In any case, what can be hurt?  We're not going to add any files
to git named "tags" anyway.)

-- 
Álvaro Herrera        Breisgau, Deutschland  —  https://www.EnterpriseDB.com/



Re: Using make_ctags leaves tags files in git

From
Michael Paquier
Date:
On Mon, May 15, 2023 at 12:33:17PM +0200, Alvaro Herrera wrote:
> But make_ctags is *our* script, so I think this rule applies to them as
> well.  (In any case, what can be hurt?  We're not going to add any files
> to git named "tags" anyway.)

Yes, you have a point about the origin of the script generating the
tags.  One thing is that one can still add a file even if listed in
what to ignore, as long as it is done with git-add -f.  Okay, that's
not going to happen.

(FWIW, looking at my stuff, I have just set up that globally in 2018
after seeing the other thread.)
--
Michael

Attachment

Re: Using make_ctags leaves tags files in git

From
Daniel Gustafsson
Date:
> On 15 May 2023, at 12:33, Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:
>
> On 2023-May-14, Tom Lane wrote:
>
>> Steve Chavez <steve@supabase.io> writes:
>>> In this case I just propose adding 'tags'. I believe it's reasonable to
>>> ignore these as they're produced by make_ctags.
>>
>> Our policy on this is that the project's .gitignore files should ignore
>> files that are produced by our standard build scripts.
>
> But make_ctags is *our* script, so I think this rule applies to them as
> well.

It is our script, but "tags" is not an artifact created by the build scripts
since make_{c|e}tags isn't part of the build so I'm not convinced we should
bother.  If we do I'm sure there are many other scripts in src/tools which
generate files we don't track (like make_mkid, which admittedly probably hasn't
been executed by anyone in a decade or so).

--
Daniel Gustafsson