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

docs: awkwardness around committing auto-generated files #47

Open
jmtd opened this issue Sep 8, 2015 · 1 comment
Open

docs: awkwardness around committing auto-generated files #47

jmtd opened this issue Sep 8, 2015 · 1 comment

Comments

@jmtd
Copy link
Contributor

jmtd commented Sep 8, 2015

We generate documentation files and commit them to the repository so that they are visible/browseable in the github web interface. However, this causes some problems

  • there's no guarantee (without additional scripting) that the current state of the templates is represented by the current state of the documentation
  • someone might modify an auto-generated file by mistake (risk mitigated by a warning in the files)
  • a change to the templates might break the doc generation, but not be noticed
  • merges, rebases, and various VCS diff activities become unwieldy with large changes in the auto generated files

This problem might get worse if/when we move to generating more stuff.

I was considering ways this might be improved and one possible solution would be to use a separate git repository for all the auto-generate content. The two repositories could be linked together via git submodule. Here is an example:

There are likely caveats with this approach, but on the face of it the integration is pretty good on the website front. "Docs" is a clickable hyperlink in the main repository, just as before, and all the generated stuff is browseable right in the github UI.

Github also has the notion of "GitHub pages" which might be a better fit for the ancillary repository. I haven't looked at that, yet.

@jmtd
Copy link
Contributor Author

jmtd commented Sep 9, 2015

Some usage instructions for this demo

$ git clone -b docs-submodule-test [email protected]:jmtd/application-templates.git submodule-test
$ cd submodule-test
$ git submodule update --init

This gives you the main repo checkout and the sub-module checked out inside ./docs.

Modifying the contents of ./docs looks like this from the POV of the parent repository:

$ ./gen_template_docs.py
$ git status
On branch docs-submodule-test
Your branch is up-to-date with 'origin/docs-submodule-test'.
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)
  (commit or discard the untracked or modified content in submodules)

    modified:   docs

no changes added to commit (use "git add" and/or "git commit -a")

@jmtd jmtd changed the title awkwardness around committing auto-generated files docs: awkwardness around committing auto-generated files Nov 25, 2015
johnpoth pushed a commit to johnpoth/application-templates that referenced this issue Mar 26, 2019
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

No branches or pull requests

1 participant