git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: File extension conflict when working with git and latex

From
Michael Haggerty <mhagger@alum.mit.edu>
Date
Mar 21, 2014, 21:31 UTC
Message-ID
<532CAF94.8040108@alum.mit.edu>
In-Reply-To
<xmqqr45vtnay.fsf@gitster.dls.corp.google.com>
On 03/21/2014 07:32 PM, Junio C Hamano wrote:
Show 26 quoted lines
> Matthias Beyer <mail@beyermatthias.de> 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
mhagger@alum.mit.edu
http://softwareswirl.blogspot.com/
Previous: Junio C HamanoNext: Torsten Bögershausen
Message 6 of 7 in “File extension conflict when working with git and latex”
  1. Matthias BeyerMar 21, 2014
  2. Simon RuderichMar 21, 2014
  3. Matthias BeyerMar 21, 2014
  4. Simon RuderichMar 21, 2014
  5. Junio C HamanoMar 21, 2014
  6. Michael HaggertyMar 21, 2014
  7. Torsten BögershausenMar 22, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.