mtt
mtt copied to clipboard
Do not deploy github pages if there were no changes
(I asked this in mtt-devel but got no reply, so I figured I'd ask here)
It looks like every time there is a PR merged, there's a new gh-pages
deployment. This is generally fine, except that sometimes the deployments are not as a result of any actual documentation changes, but just changes in the timestamps of the documentation. I.e., no doc changes occurred, but the doc generator ran, it updated the timestamps, and therefore those timestamp changes were recorded as a git diff, which then resulted in another gh-pages
deployment.
Can such spurious commits / deployments be avoided?
If you can figure it out, please go ahead and make the change. I have no idea how to get Travis to do it. Akshaya's internship is over and she has departed for the school year. I'm not sure if someone else can chase it down.
FWIW, I don't think it's a matter of not invoking Travis -- I think it's fine to invoke Travis every time. What would be nice is if Travis runs the generator, do the git commit
, and then perhaps take a cursory examination of the git diff
and see "oh, this just has timestamp updates" and therefore decide not to git push
.
I don't know if I have the cycles, either.
I found this https://stackoverflow.com/questions/48455623/skip-travis-build-if-an-unimportant-file-changed, maybe it close to what you want to do?
I guess it begs this question:
Git only sees the content of the file to determine if it is changed. It is not concerned with the timestamp if the content is the same. Make sure there really isn't any change in the content, including line endings.
So it sounds like the doc generator runs, but there isn't any change? If all that changes is the timestamp, then there shouldn't have been a diff, yes?
I guess I'm confused as to how just timestamp updates resulted in a diff being committed at all.
Sorry, I should be more clear -- the timestamps I'm referring to are text items in the file. Not the actual filesystem timestamp. For example, here's a recent diff -- https://github.com/open-mpi/mtt/commit/09098d0c141b406be54004a31e1a31f2d52a4bbf.
diff --git a/latex/refman.tex b/latex/refman.tex
index 8d05a7b..e903547 100644
--- a/latex/refman.tex
+++ b/latex/refman.tex
@@ -67,8 +67,8 @@
\fancyhead[RO]{\fancyplain{}{\bfseries\thepage}}
\fancyfoot[LE]{\fancyplain{}{}}
\fancyfoot[CE]{\fancyplain{}{}}
-\fancyfoot[RE]{\fancyplain{}{\bfseries\scriptsize Generated on Fri Aug 24 2018 18\-:46\-:00 for pymtt by Doxygen }}
-\fancyfoot[LO]{\fancyplain{}{\bfseries\scriptsize Generated on Fri Aug 24 2018 18\-:46\-:00 for pymtt by Doxygen }}
+\fancyfoot[RE]{\fancyplain{}{\bfseries\scriptsize Generated on Fri Aug 24 2018 18\-:46\-:09 for pymtt by Doxygen }}
+\fancyfoot[LO]{\fancyplain{}{\bfseries\scriptsize Generated on Fri Aug 24 2018 18\-:46\-:09 for pymtt by Doxygen }}
\fancyfoot[CO]{\fancyplain{}{}}
\fancyfoot[RO]{\fancyplain{}{}}
\renewcommand{\footrulewidth}{0.4pt}
@@ -120,7 +120,7 @@
\vspace*{1cm}
{\large Generated by Doxygen 1.8.6}\\
\vspace*{0.5cm}
-{\small Fri Aug 24 2018 18:46:00}\\
+{\small Fri Aug 24 2018 18:46:09}\\
\end{center}
\end{titlepage}
\clearemptydoublepage
Hmmm - I wonder why that information even needs to be committed? Maybe the problem would go away if we removed that file (or at least the timestamps in it) from the repo?
I think those timestamps are just part of the files that Doxygen generates.
I think it's ok to generate those timestamps -- it shows that the files are current, after all. It would just be nice if we can somehow determine that the timestamps are the only thing in the diff, and therefore it's not worth pushing.
I think the solution to this is:
Only run gh-pages travisci IF something in mtt/docs
changes