From 38a9c46a47b1b839c159d162a0942bcb55894bdb Mon Sep 17 00:00:00 2001 From: Matthieu Moy Date: Tue, 18 Jun 2019 22:22:39 +0200 Subject: [PATCH 1/2] builddir relative to . or to Git's root depending on whether --whole-tree is used 9e5967f (Implement build-dir option, 2019-02-13) introduced a --build-dir option. Unfortunately, the build directory was considered relative to the repository root, not to the current directory. When --whole-tree is not used and the main file was in a sub-directory, the PDF was generated in e.g. subtree/file.pdf, and looked for in ./file.pdf. --- git-latexdiff | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/git-latexdiff b/git-latexdiff index 7a5cdfd..06e4de4 100755 --- a/git-latexdiff +++ b/git-latexdiff @@ -537,13 +537,6 @@ fi mainbase=$(basename "$main" .tex) maindir=$(dirname "$main") -# create the build directory (containing the final PDFs) if the param was set -if test -n "$use_build_dir" ; then - builddir="$maindir/$use_build_dir" -else - builddir="$maindir" -fi - tmpdir=$tmpdir_prefix/git-latexdiff.$$ mkdir "$tmpdir" || die "Cannot create temporary directory." @@ -570,8 +563,20 @@ fi if test "$subtree" = 1 && test -n "$git_prefix"; then checkoutroot=$git_prefix + # create the build directory (containing the final PDFs) if the param was set + if test -n "$use_build_dir" ; then + builddir="$use_build_dir" + else + builddir="." + fi else checkoutroot="." + # create the build directory (containing the final PDFs) if the param was set + if test -n "$use_build_dir" ; then + builddir="$git_prefix/$use_build_dir" + else + builddir="$git_prefix" + fi fi # Checkout a subtree, without touching the index ("git checkout" would) From 71425672d2cd1bdb8b08c7b2eb983fdfc0008cf8 Mon Sep 17 00:00:00 2001 From: Matthieu Moy Date: Tue, 18 Jun 2019 22:25:13 +0200 Subject: [PATCH 2/2] Don't say both that the PDF file is inexistant and empty --- git-latexdiff | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/git-latexdiff b/git-latexdiff index 06e4de4..20745eb 100755 --- a/git-latexdiff +++ b/git-latexdiff @@ -737,9 +737,7 @@ pdffile="$builddir/$mainbase".pdf if test ! -r "$pdffile" ; then echo "No PDF file generated." compile_error=1 -fi - -if test ! -s "$pdffile" ; then +elif test ! -s "$pdffile" ; then echo "PDF file generated is empty." compile_error=1 fi