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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Paul Menzel <paulepanter@xxxxxxxxxxxxxxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]