All of lore.kernel.org
 help / color / mirror / Atom feed
* git ate my home directory :-(
@ 2013-03-25 21:38 Richard Weinberger
  2013-03-25 21:43 ` Jonathan Nieder
  0 siblings, 1 reply; 35+ messages in thread
From: Richard Weinberger @ 2013-03-25 21:38 UTC (permalink / raw)
  To: git

Hi!

Today I've discovered that on the build server my home directory was empty.
A post-mortem analysis showed that the git-clean command I've added to my kernel build script
is the evil doer.
In my scripts I'm setting GIT_DIR to use git-fetch and git-reset without changing the
current working directory all the time.
But calling git-clean with GIT_DIR acts basically like a "rm -Rf .".

Here a small demo:

test@linux:~> git --version
git version 1.8.1.4
test@linux:~> ls
test@linux:~> touch a b c d e
test@linux:~> mkdir x
test@linux:~> cd x
test@linux:~/x> git init
Initialized empty Git repository in /home/test/x/.git/
test@linux:~/x> cd ..
test@linux:~> ls
a  b  c  d  e  x
test@linux:~> export GIT_DIR=/home/test/x/.git/
test@linux:~> git clean -d -f
Removing a
Removing b
Removing c
Removing d
Removing e
Removing x/
test@linux:~> ls
test@linux:~>
test@linux:~> # :-(

Is this behavior intended?

Thanks,
//richard

^ permalink raw reply	[flat|nested] 35+ messages in thread

end of thread, other threads:[~2013-03-27 13:06 UTC | newest]

Thread overview: 35+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-25 21:38 git ate my home directory :-( Richard Weinberger
2013-03-25 21:43 ` Jonathan Nieder
2013-03-25 22:02   ` Junio C Hamano
2013-03-25 22:08     ` Jonathan Nieder
2013-03-25 22:15       ` Junio C Hamano
2013-03-25 22:06   ` Junio C Hamano
2013-03-25 22:09     ` Richard Weinberger
2013-03-25 22:15       ` Jonathan Nieder
2013-03-25 22:20       ` Junio C Hamano
2013-03-25 22:27         ` Richard Weinberger
2013-03-25 22:13     ` Jonathan Nieder
2013-03-25 22:21       ` Brandon Casey
2013-03-26  8:02     ` Philip Oakley
2013-03-26  9:48       ` Duy Nguyen
2013-03-26 15:04         ` Jeff King
2013-03-26 16:32           ` Junio C Hamano
2013-03-27 13:05           ` Duy Nguyen
2013-03-26 21:47         ` Philip Oakley
2013-03-26 13:07       ` Richard Weinberger
2013-03-26 14:56         ` Jeff King
2013-03-26 17:06           ` Richard Weinberger
2013-03-26 17:20             ` demerphq
2013-03-26 17:48               ` Jeff King
2013-03-26 19:08                 ` demerphq
2013-03-26 17:41             ` Jeff King
2013-03-26 18:20               ` Junio C Hamano
2013-03-26 20:08                 ` Jeff King
2013-03-26 20:11                   ` [DONOTAPPLY PATCH 1/3] environment: set GIT_WORK_TREE when we figure out work tree Jeff King
2013-03-26 20:16                     ` Jonathan Nieder
2013-03-26 20:12                   ` [DONOTAPPLY PATCH 2/3] setup: warn about implicit worktree with $GIT_DIR Jeff King
2013-03-26 20:21                     ` Jonathan Nieder
2013-03-26 20:27                       ` Jeff King
2013-03-26 20:35                         ` Jonathan Nieder
2013-03-27  8:24                         ` Matthieu Moy
2013-03-26 20:13                   ` [DONOTAPPLY PATCH 3/3] setup: treat GIT_DIR without GIT_WORK_TREE as a bare repo Jeff King

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.