git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Torsten Bögershausen" <tboegi@web.de>
To: Matthias Beyer <mail@beyermatthias.de>, git@vger.kernel.org
Subject: Re: File extension conflict when working with git and latex
Date: Sat, 22 Mar 2014 08:11:50 +0100	[thread overview]
Message-ID: <532D37B6.1000306@web.de> (raw)
In-Reply-To: <20140321161324.GC2965@fu.192.168.200.1>

On 2014-03-21 17.13, Matthias Beyer wrote:
> Hi,
> 
> I struggled with a really nasty issue today (and yesterday):
> 
> I work on a semester project paper which is written in latex and
> therefor version-controlled with git. We compile the document using
> pdflatex, we automate the compiling with make.
> 
> pdflatex generates some temporary files, which are required if you
> call it the second and third time (it is a top-down compiler, which
> needs to be called several times). One of the file extensions is
> ".idx", which (kind of) conflicts with file extensions in .git/.
> 
> Unfortunetely, we wrote our `make clean` task recursively. I think you
> can imagine what went wrong: The clean-task corrupted the repository,
> as it removed .idx files from within .git/.
> 
> I lost work because of this ugly name collision.
> 
> My question now:
> 
> 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?
> 
The idx files are mentioned here:
http://www.git-scm.com/book/en/Git-Internals-Packfiles

(Otherwise, some random thoughts:)
- stay out of the .git directory, whatever you do
   (I lost some data because my faulty scripts using sed to replace
   "s/this/that/" and went into the .git directory) 
- Don't delete "read-only" files
   (The .idx files are all  "r--r--r--")
  Or in other words, do not use "rf -f" in a script, unless you know exactly
  what you and the script are doing.
- Replace "rm -f" whith "mv /tmp" could be an option
- As mentioned before, "git clean" can be an option,
  I used it once when the "make clean", "make distclean", "make reallydistclean"
  did not work as expected by me,
  some auto-generated config files where still not deleted. 
- Make backups of your repo (frequently)
- push the repo to a backup repo (frequently)
- Use $GIT_DIR to move the repo out of your work tree:
  https://www.kernel.org/pub/software/scm/git/docs/git.html

- Prepare a patch that renames the *.idx files used by Git into
  *.gitidx, *.gidx, *.packidx, (and the *.pack into *.packdata ??) 

Hopefully you did not loose too much data, and if you have an idea how to improve
things, you may consider sending a patch, improvements are possible and welcome.

      parent reply	other threads:[~2014-03-22  7:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-21 16:13 File extension conflict when working with git and latex Matthias Beyer
2014-03-21 16:36 ` Simon Ruderich
2014-03-21 16:46   ` Matthias Beyer
2014-03-21 17:01     ` Simon Ruderich
2014-03-21 18:32 ` Junio C Hamano
2014-03-21 21:31   ` Michael Haggerty
2014-03-22  7:11 ` Torsten Bögershausen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=532D37B6.1000306@web.de \
    --to=tboegi@web.de \
    --cc=git@vger.kernel.org \
    --cc=mail@beyermatthias.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).