processone / xmpp

Erlang/Elixir XMPP parsing and serialization library on top of Fast XML

Home Page:http://process-one.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Recommend to commit automatic files separately

badlop opened this issue · comments

This xmpp library has:

  • human-modified files like xmpp_codex.spec
  • and many files that are automatically generated runing make spec, like xmpp_codex.hrl and all the src/xep*.erl files
  • of course, after compilation, there are *.beam and dependencies, but those are not tracked in git.

When committing to the xmpp git repository, some people first adds commits with his manual changes, and later adds another final commit with only the automatic changes. An example of this is the commit 1b438dd that fixes a small bug, and later the commit 3f18c9e with all the automatically-generated changes.

But in other cases, commits include both the human changes and the automatic changes in one single commit. That's a little annoying, because when reading that commit, you must know/remember which files were automatically generated, to not bother reading them, and focus only on the ones that the original author really modified.

Some ideas to alleviate this:

  • A) recommend in README.txt to not mix in the same commit human and automatic changes
  • B) add git hook that would check before commit if those files were updated, then reject the commit. The problem is that each user would need to enable it
  • C) add github action that runs "make spec" and commits result if necessary: we don't need to commit those anymore ourselves, and nothing breaks if we forget and commit them
  • D) ... some other ideas
  • Z) remove automatic files completely from git, and change Makefile so they are generated when compiling *.beam files. However, if xmpp was designed that way, surely there was a good reason. Changing this without considering the reason could produce unexpected problems.

The easiest solution, probably good enough, that doesn't break anything else, is A+C: recommend to not commit changes in automatic files, and add github action that updates and commits those automatic files.