Xilinx Vivado can export the content of a *.xpr file (Xilinx Vivado project file) as Tcl. Therefore a Tcl command exists in GUI mode (project mode):
write_project_tcl {C:/.../project/KC705.tcl}
From a version control perspective, it's better to version control such Tcl files instead of *.xpr files, because *.xpr files contain XML with a steadily changing content (IDs, order of files, ...). One could consider *.xpr files as binary or at least not good for merging!
Developers can forget to export their projects via menu: file -> write project tcl
or to enter that long Tcl command manually before closing the project in the GUI.
Git offers pre-commit hooks. I would like to create a hook that converts (exports) a *.xpr file to a corresponding project tcl file.
So my question is: How to open and export a *.xpr file (via Tcl?) to a project Tcl file? A Git shall never contain outdated project information, because a developer missed to click export in the menu.