Re: [PATCH 3/3] doc/Makefile: drop doc-diff worktree and temporary files on "make clean"
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Sep 17, 2018, 20:52 UTC
- Message-ID
- <CAPig+cTmfnXPX-5Ffy1TYfhVvvGsNe0j6XR3a4N2+z0_L-4aKA@mail.gmail.com>
- In-Reply-To
- <CAPig+cSrvvWn1rd6TcG8H6tGvGDvfNJZE3KnxYazwDTfxAkVeg@mail.gmail.com>
On Mon, Sep 17, 2018 at 4:43 PM Eric Sunshine <sunshine@sunshineco.com> wrote:
Show 5 quoted lines
> I did consider this case and felt that it would be reasonable for it > to error out and ignore the error if git was missing or if the > directory was not a repository. And, I _thought_ I had prefixed the > line with "-" to handle just such a case, but apparently I botched it. > Oh well.
Dredging up from memory, I think the omission of "-" from the Makefile line was intentional since I specifically handled the case of missing "git" command in the script itself by ignoring any error from it. Specifically, this excerpt from doc-diff:
if test -n "$clean"
then
test $# -eq 0 || usage
git worktree remove --force "$tmp/worktree" 2>/dev/null
rm -rf "$tmp"
exit 0
fiin which a problem invoking git is explicitly ignored and the script exits cleanly, so no Makefile "-" is needed.
Unfortunately, I forgot about the:
. "$(git --exec-path)/git-sh-setup"
which happens earlier in the script.