Thread (6 messages) flat view 6 messages, 3 authors, 2016-06-15

Re: use case: keep the output of a markup (TeX) file under revision control

From: Jakub Narebski <hidden>
Date: 2016-06-15 22:50:35

Paul Menzel [off-list ref] writes:
I have the following use case and need an advise from you professionals.

A friend and I are writing a paper using TeX¹ and keep the files under
revision control using Git. This works fine so far. But I want to also
have the output (PDF) of the markup file under revision control to be
able to access the PDF files even if for example no TeX installation is
available on a system.

The problem now is, since the output is no plain text file, that
merging/rebasing always shows conflicts which Git, of course, cannot
solve.

Is there a way to set that up so that there are no conflicts? Would a
pre-commit hook work which generates the PDF file prior to committing?
And if no TeX installation is available it would just ignore the PDF
files?

I could not find anything on the Web because having PDF as search string
would just show up how to generate documentation about Git.
As an alternative to Stefan Naewe solution of using separate "orphan"
(unrelated) branch to store PDF files, like Git project does with
generated documentation (manpages in 'man' branch, HTML version in
'html' branch), you can try the following:

1. Mark PDF files as binary, if they are not already considered binary.

2. Create custom merge driver for PDF files, which would compile
   source *.tex file to PDF, provided that TeX is installed, and that
   source file itself is not in merge conflict

3. Creating pre-commit hook would ensure that you have refershed PDF
   files during ordinary commit.  Note that this hook is not always ran
   (you can force running it with --verify option to git-commit).

HTH
-- 
Jakub Narebski
Poland
ShadeHawk on #git
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help