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

Remove and ignore auto-generated files #2

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

h3xx
Copy link
Contributor

@h3xx h3xx commented Nov 9, 2021

Get them back by running ./autogen.sh on a system with GNU autotools installed.

@h3xx
Copy link
Contributor Author

h3xx commented Nov 9, 2021

Note: The reason I'm doing this is because I have a version 0.8.1 tarball available, and I want a cleaner repo before I submit a PR to add those changes (lots of updates to auto-generated files that muddy up the commit).

  • 0.8.1 upgrade with these files here: 34 files changed, 3694 insertions(+), 2919 deletions(-)
  • 0.8.1 upgrade without these files here: 25 files changed, 90 insertions(+), 69 deletions(-)

@mok0
Copy link
Owner

mok0 commented Nov 9, 2021

Running autogen.sh that you have added requires that you have autotools installed on your machine. Normally, distributed software contains a complete configure system so you can compile and install the software simply by going configure; make; sudo make install.

@h3xx
Copy link
Contributor Author

h3xx commented Nov 9, 2021

You're right. It is common practice to include these files in a release tarball. That's different than removing the auto-generated files from source control. It's possible to generate those files and add them to a release tarball using GitHub Releases.

However, it isn't common practice to keep generated files in source control. The reason for this is threefold:

  1. Deliberately keeping autogenerated files adds extra steps to development effort, which are likely to be forgotten.

Say I change one line in configure.ac now I have to run autoreconf just so I can commit.

  1. When someone checks in a change, it makes it less obvious what the change does.

(Imagine the same scenario as before: a single-line change to configure.ac) Say I run a different version of autotools than the one the last committer used, now the file is generated differently and my commit now has 1000 lines of changes I didn't make by hand. It's not so obvious now that I just intended to change the one line.

  1. It leads to extra development effort to maintain the extra files.

Say you're coordinating with a team running an ancient version of autotools, and they check in a change and run autoreconf just as they should, but something went wrong with the output and it now won't run configure due to a missing macro. Now it's up to you to fix it. >:-E

TL;DR A good rule of thumb is: If you didn't write it by hand, don't check it in to source control.

@mok0
Copy link
Owner

mok0 commented Nov 11, 2021

I see your point, I will take a closer look at your pull request. Thanks!

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.

2 participants