git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* use case: keep the output of a markup (TeX) file under revision control
@ 2011-02-17 10:37 Paul Menzel
  2011-02-17 12:03 ` Stefan Naewe
  2011-02-17 12:19 ` Jakub Narebski
  0 siblings, 2 replies; 6+ messages in thread
From: Paul Menzel @ 2011-02-17 10:37 UTC (permalink / raw)
  To: git

[-- Attachment #1: Type: text/plain, Size: 1079 bytes --]

Dear Git folks,


(Please CC me when replying since I am not subscribed.)

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.


Thanks,

Paul


¹ Actually it is ConTeXt [1].

[1] http://wiki.contextgarden.net/Main_Page

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: use case: keep the output of a markup (TeX) file under revision control
  2011-02-17 10:37 use case: keep the output of a markup (TeX) file under revision control Paul Menzel
@ 2011-02-17 12:03 ` Stefan Naewe
  2011-02-17 19:51   ` Paul Menzel
  2011-02-17 12:19 ` Jakub Narebski
  1 sibling, 1 reply; 6+ messages in thread
From: Stefan Naewe @ 2011-02-17 12:03 UTC (permalink / raw)
  To: Paul Menzel; +Cc: git@vger.kernel.org

On 2/17/2011 11:37 AM, Paul Menzel wrote:
> Dear Git folks,
> 
> 
> (Please CC me when replying since I am not subscribed.)
> 
> 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.

Why don't you keep the PDF files in a separate branch ? Look at git's
git repository (http://git.kernel.org/?p=git/git.git) in the html 
and man branches.

Regards,
  Stefan
-- 
----------------------------------------------------------------
/dev/random says: If at first you don't succeed, work for Microsoft.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: use case: keep the output of a markup (TeX) file under revision control
  2011-02-17 10:37 use case: keep the output of a markup (TeX) file under revision control Paul Menzel
  2011-02-17 12:03 ` Stefan Naewe
@ 2011-02-17 12:19 ` Jakub Narebski
  2011-02-17 12:27   ` Stefan Naewe
  1 sibling, 1 reply; 6+ messages in thread
From: Jakub Narebski @ 2011-02-17 12:19 UTC (permalink / raw)
  To: Paul Menzel; +Cc: git, Jakub Narebski

Paul Menzel <paulepanter@users.sourceforge.net> 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: use case: keep the output of a markup (TeX) file under revision control
  2011-02-17 12:19 ` Jakub Narebski
@ 2011-02-17 12:27   ` Stefan Naewe
  0 siblings, 0 replies; 6+ messages in thread
From: Stefan Naewe @ 2011-02-17 12:27 UTC (permalink / raw)
  To: Jakub Narebski; +Cc: Paul Menzel, git@vger.kernel.org

On 2/17/2011 1:19 PM, Jakub Narebski wrote:
> Paul Menzel <paulepanter@users.sourceforge.net> writes:
> 
> 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).

??

I only see '--no-verify' in 'git help commit' to bybass the 
'pre-commit' hook but not the other way round.

Puzzled,
  Stefan
-- 
----------------------------------------------------------------
/dev/random says: Beam me up Scotty. This isn't the men's room.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: use case: keep the output of a markup (TeX) file under revision control
  2011-02-17 12:03 ` Stefan Naewe
@ 2011-02-17 19:51   ` Paul Menzel
  2011-02-18  6:59     ` Stefan Naewe
  0 siblings, 1 reply; 6+ messages in thread
From: Paul Menzel @ 2011-02-17 19:51 UTC (permalink / raw)
  To: Stefan Naewe; +Cc: git@vger.kernel.org

[-- Attachment #1: Type: text/plain, Size: 2631 bytes --]

Am Donnerstag, den 17.02.2011, 13:03 +0100 schrieb Stefan Naewe:
> On 2/17/2011 11:37 AM, Paul Menzel wrote:

> > (Please CC me when replying since I am not subscribed.)
> > 
> > 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.
> 
> Why don't you keep the PDF files in a separate branch ? Look at git's
> git repository (http://git.kernel.org/?p=git/git.git) in the html 
> and man branches.

Very interesting. Thank you very much for this hint.

Is the used solution in git’s git repository a result of the problem
with maintaining generated output from source files or does it have
other other advantages too?

When creating TeX documents – at least in my work flow – I always have
the PDF file open in parallel. Would that be a problem when having it in
a separate branch?

Also I guess that this is done automatically too (saying autogenerated
in `git log origin/man`). I could not find the script though.

        $ git grep Autogen
        git-gui/Makefile:        echo '# Autogenerated by git-gui Makefile' >$@ && \
        git-gui/git-gui.sh:if {[gets $fd] eq {# Autogenerated by git-gui Makefile}} {

and searching for »git "Autogenerated manpages for"« did not return
anything useful for me.

Additionally I am confused where the SHA id g43f9f in »Autogenerated
manpages for v1.7.4.1-42-g43f9f« comes from. I could not find that
commit in `origin/master` or `git log v1.7.4.1`.

The last thing is that in git’s git repository the autogeneration of the
manual pages does not seem to happen every commit (Is it a cron job?).
In my use case the PDF file should be generated after every commit. Is a
separate branch the way to go here?


Thanks,

Paul

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: use case: keep the output of a markup (TeX) file under revision control
  2011-02-17 19:51   ` Paul Menzel
@ 2011-02-18  6:59     ` Stefan Naewe
  0 siblings, 0 replies; 6+ messages in thread
From: Stefan Naewe @ 2011-02-18  6:59 UTC (permalink / raw)
  To: Paul Menzel; +Cc: git@vger.kernel.org

On 2/17/2011 8:51 PM, Paul Menzel wrote:
>> Why don't you keep the PDF files in a separate branch ? Look at git's
>> git repository (http://git.kernel.org/?p=git/git.git) in the html 
>> and man branches.
> 
> Very interesting. Thank you very much for this hint.
> 
> Is the used solution in git’s git repository a result of the problem
> with maintaining generated output from source files or does it have
> other other advantages too?
> 
> When creating TeX documents – at least in my work flow – I always have
> the PDF file open in parallel. Would that be a problem when having it in
> a separate branch?

I'd create a second clone and checkout the 'PDF' (or whatever you might call
it) branch there.

> Also I guess that this is done automatically too (saying autogenerated
> in `git log origin/man`). I could not find the script though.
> 
>         $ git grep Autogen
>         git-gui/Makefile:        echo '# Autogenerated by git-gui Makefile' >$@ && \
>         git-gui/git-gui.sh:if {[gets $fd] eq {# Autogenerated by git-gui Makefile}} {
> 
> and searching for »git "Autogenerated manpages for"« did not return
> anything useful for me.

Try: git grep "Autogenerated " origin/todo
It's in 'dodoc.sh' on branch 'todo'

> Additionally I am confused where the SHA id g43f9f in »Autogenerated
> manpages for v1.7.4.1-42-g43f9f« comes from. I could not find that
> commit in `origin/master` or `git log v1.7.4.1`.

Try: git show 43f9f  (and 'git help describe')
 
> The last thing is that in git’s git repository the autogeneration of the
> manual pages does not seem to happen every commit (Is it a cron job?).
> In my use case the PDF file should be generated after every commit. Is a
> separate branch the way to go here?

I guess the autogeneration takes place on every push to 'master'. That
should work for you, too. Your decision...

HTH,
  Stefan
-- 
----------------------------------------------------------------
/dev/random says: I was going to procrastinate, but I put it off....

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-02-18  6:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-17 10:37 use case: keep the output of a markup (TeX) file under revision control Paul Menzel
2011-02-17 12:03 ` Stefan Naewe
2011-02-17 19:51   ` Paul Menzel
2011-02-18  6:59     ` Stefan Naewe
2011-02-17 12:19 ` Jakub Narebski
2011-02-17 12:27   ` Stefan Naewe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).