bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gnulib doesn't add lib/spawn.h to .gitignore?


From: Stefano Lattarini
Subject: Re: gnulib doesn't add lib/spawn.h to .gitignore?
Date: Tue, 02 Oct 2012 13:06:45 +0200

On 10/01/2012 12:00 AM, Bruno Haible wrote:
> [Dropping bug-coreutils from CC]
> 
> Hi Stefano,
>
Hi Bruno, sorry for the late answer.

>> OK, this is a minor annoyance rather than a real bug, but I guess
>> reporting it won't hurt.
>>
>> In GNU coreutils, the gnulib-provided 'bootstrap' script fails to add
>> the generated file 'lib/spawn.h' to the .gitignore in 'lib/':
>>
>>   $ ./bootstrap && ./configure && make
>>   ... [all is OK]
>>   $ git status
>>   ...
>>   # Untracked files:
>>   #   (use "git add <file>..." to include in what will be committed)
>>   #
>>   #       lib/spawn.h
>>   nothing added to commit but untracked files present (use "git add" to 
>> track)
>>   $ grep spawn lib/.gitignore
>>   /spawn-pipe.c
>>   /spawn-pipe.h
>>   /spawn.in.h
>>   /spawn_faction_addclose.c
>>   /spawn_faction_adddup2.c
>>   /spawn_faction_addopen.c
>>   /spawn_faction_destroy.c
>>   /spawn_faction_init.c
>>   /spawn_int.h
>>   /spawnattr_destroy.c
>>   /spawnattr_init.c
>>   /spawnattr_setflags.c
>>   /spawnattr_setsigmask.c
>>   /spawni.c
>>   /spawnp.c
>>   /w32spawn.h
> 
> I believe that the right choice of which files to put under version
> control and which files to declare gitignored, in a project that uses
> the GNU Autotools, is the following:
> 
> Because releases are rolled through automake's "make distcheck", unused files
> can lie around in the working checkout. A separate "-clean" checkout is used
> which should not contain modifications nor unused files.
>
>                                                    in              in
>                                   Committed    .gitignore    .git/info/exclude
> 
> Source                                Y             N               N
> 
> gnulib-cache.m4                       Y             N               N
> 
> Brought in by autotools,              N             Y               N
> gnulib-tool
> 
> Generated by autotools                N             Y               N
> 
> Generated by "make" and               N             Y               N
> distributed (i.e. kept by
> "make distclean")
> 
> Generated by "make" and               N             N               Y
> not distributed (i.e. erased by
> "make distclean")
>
Here I disagree: I believe also this kind of files should be listed
in .gitignore.  So I'd appreciate if the .gitignore file generated by
gnulib-tool would list all the files that, through rules provided by
gnulib, are (or can be) be generated by "make all" and are cleaned by
"make distheck".  Still, ad I said, this was just a minor annoyance,
and now that I understand the gnulib behaviour was deliberate, you are
fully free to disagree and keep the situation as-is; I can adjust by
tweaking .git/info/exclude, as you suggested.

> Editor backup files                   N             Y               N
> 
> 
> Currently gnulib-tool augments .gitignore for the files categorized as
> "Brought in by autotools, gnulib-tool".
> 
> An option that would tell gnulib-tool to add also the files "Generated by
> "make" and distributed" could be useful, for modules that have a
> MAINTAINERCLEANFILES augmentation (such as 'parse-datetime' or 'iconv_open').
> 
> But what you are talking about is the category "Generated by "make" and
> not distributed". I believe it depends on project policy whether such files
> go into .gitignore. To get at this list of files, gnulib-tool should collect
> the intersection of BUILT_SOURCES and MOSTLYCLEANFILES of all modules, right?
>
Well, for my "use case", it would be enough if, for each '*.h.in' file
added to .gitignore, it also added the corresponding '*.h' file.  Not
truly general, but good enough for me.  Still, as I said, no big deal.

Thanks,
  Stefano



reply via email to

[Prev in Thread] Current Thread [Next in Thread]