Subject: Re: File extension conflict when working with git and latex

From: Michael Haggerty <[email-masked]>
Date: Fri, 21 Mar 2014 22:31:00 +0100

On 03/21/2014 07:32 PM, Junio C Hamano wrote:
> Matthias Beyer <[email-masked]> writes:
> 
>> I know, I can fix this by fixing the clean task in my Makefile. But
>> maybe someone somewhere on this world doesn't know the git internals
>> as good as me (and, of course, my coworker). Is there _any chance
>> at all_ that this gets mentioned somewhere, so others don't fall into
>> this pit?
> 
> Surely, we are here to please ;-)  All of us want to make sure
> newbies do not shoot themselves in the foot.
> 
> But the problem is what exactly should be mentioned.  With a fresh
> wound with your LaTeX project still in your mind, you may be tempted
> to special case ".idx", but other newbies may inflict the same kind
> of hurt on themselves with different "find" patterns, e.g.
> 
>     $ find . -name '[0-9a-f]*[0-9a-f]' -type f -print | xargs rm -f
> 
> when they know their project creates hexadecimal-numbered temoprary
> files, or whatever other pattern that match the files they do not
> care about, that also happens to match whatever is in $GIT_DIR.  The
> only common caution that helps us to make sure "others do not fall
> into this pit" is "Files and directories in $GIT_DIR are used to
> record your work; do not muck with them unless you know what you are
> doing e.g. manually repairing a corrupt repository", but that is a
> bit lame, isn't it?

It might help some people to show the "find" incantation for skipping
files under .git, which I think would be something like

    find . -name .git -prune -o \( [...] \) -print0 | xargs -0 rm -f

where "[...]" is whatever condition the user would otherwise use.

Michael

-- 
Michael Haggerty
[email-masked]
http://softwareswirl.blogspot.com/