\RequirePackage{shellesc}
\ShellEscape{latexdiff --flatten main-staged1.tex main.tex > main-d.tex}
\input{main-d}
\documentclass{thesis}
\title{Latexdiff}