Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proposal to close #525 by generating build/.gitignore #528

Merged
merged 3 commits into from Aug 4, 2021
Merged

proposal to close #525 by generating build/.gitignore #528

merged 3 commits into from Aug 4, 2021

Conversation

urbanjost
Copy link
Contributor

Seems like #525 is reasonable; it does put a few lines that are git(1)specific into fpm, but is does not make it dependent on the .gitignore file (that is, someone not using git(1) is not affected); and is more reliable at ensuring build/ is ignored which is very dominantly the case. Any up or down votes on this simple change?

Copy link
Member

@awvwgk awvwgk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I think this brings an improvement for working with git. But I think we should consider keeping the toplevel .gitignore created by fpm new.

@awvwgk awvwgk linked an issue Jul 31, 2021 that may be closed by this pull request
Copy link
Member

@LKedward LKedward left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @urbanjost. These changes look fine to me. If I understand correctly, this fixes a problem where the root level .gitignore can ignore valid source directories as well.

So I put the orginal .gitignore back in, and even made it bigger if
"fpm new -full" is used. Here is why ...

Although I preferred only auto-generating .gitignore in build/ initially,
after reviewing the comments I built a list of public github projects
containing fpm.toml files and pulled them and eliminated most trivial
ones that appeared to just be experiments in using fpm by somewhat
arbitrarily removing those with less than one hundred lines of Fortran
source and found the majority of those remaining had a customized (ie. not
the default one built by the "fpm new" subcommand) .gitignore file;
indicating many projects need a .gitignore file in the top directory,
so might as well keep seeding it(?),

I found seven that did not have a .gitignore at all, reinforcing the
need to put one in the build directory itself, as this still does. For
the most part those appeared to be unintentional and looked like several
were inadvertently storing binaries on github as a result, indicating
the change to making a build/.gitignore file is a good idea.

stdlib-fpm does not have one, but did not have a build/ directory on
github, but the change to put one in build/ itself will prevent that being
a problem for anyone that forks or clones it, so that is covered now.

I found a pattern where it looks like a number of large sites are
setting up to be able to build with other systems other than fpm(1),
which by itself does not need a .gitignore file of any complexity;
just perhaps skipping non-core files like logs and fodder and other
user-specific needs it is not too easy to optimize except by exclusion
(that is, exclude everything except the default files used by fpm,
which does not feel like a good direction).

On the other hand, I found two other others using the default github list
for Fortran projects, and saw several other projects essentially making
their own attempt at the same list, but I think a large .gitignore file
is conflating for a new (and probably typical) user so I put back the
simple one by default when "fpm new" is used, but if "fpm new -full"
is used, add the github recommendations.  The github recommendations
do not directly benefit a pure fpm project, but at least so far that is
still a minority of the sample packages I found; so adding it at all or
adding it via --full is a bit kluge, but seemed like it would make handy
information readily available if perhaps not in the most intuitive way,
but would not conflate basic usage.
@awvwgk
Copy link
Member

awvwgk commented Aug 4, 2021

Thanks, John. I'll go ahead and merge this patch.

@awvwgk awvwgk merged commit 613da74 into fortran-lang:master Aug 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automatically create gitignore for build artifacts
3 participants