also sprach Junio C Hamano <gitster@xxxxxxxxx> [2008.05.15.0325 +0100]: > In any case, this patch is a bit worrying. Your gut feeling is a good one! See the following typescript. You'll notice that the new files created in wc2 pushed and pulled get merged into the first wc at the wrong location, and index and working dir get out of sync. This only happens when I export GIT_DIR in git-sh-setup. Ouch. Arguably, this is a bug in git-merge though! % GIT_DIR=repo.git git --bare init Initialized empty Git repository in repo.git/ % mkdir wc && cd wc && git init Initialized empty Git repository in .git/ % git remote add origin `pwd`/../repo.git % git config branch.master.remote origin % git config branch.master.merge refs/heads/master % touch a; git add a; git commit -m. Created initial commit c80aa71: . 0 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 a % git push origin master Counting objects: 3, done. Writing objects: 100% (3/3), 196 bytes, done. Total 3 (delta 0), reused 0 (delta 0) Unpacking objects: 100% (3/3), done. To /home/madduck/.tmp/cdt.SLg15374/wc/../repo.git * [new branch] master -> master % mkdir foo && touch foo/a && git add foo/a && git commit -m. Created commit 8ccd80a: . 0 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 foo/a % git push Counting objects: 3, done. Compressing objects: 100% (2/2), done. Unpacking objects: 100% (2/2), done. Writing objects: 100% (2/2), 247 bytes, done. Total 2 (delta 0), reused 0 (delta 0) To /home/madduck/.tmp/cdt.SLg15374/wc/../repo.git c80aa71..8ccd80a master -> master % cd ../ % git clone repo.git wc2 Initialized empty Git repository in /home/madduck/.tmp/cdt.SLg15374/wc2/.git/ % cd wc2 % cd foo && mkdir bar && touch bar/a && git add bar/a && git commit -m. Created commit cba76e8: . 0 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 foo/bar/a % git push Counting objects: 5, done. Compressing objects: 100% (3/3), done. Unpacking objects: 100% (3/3), done. Writing objects: 100% (3/3), 315 bytes, done. Total 3 (delta 0), reused 0 (delta 0) To /home/madduck/.tmp/cdt.SLg15374/repo.git 8ccd80a..cba76e8 master -> master % cd ../../wc/foo % ls a % git pull remote: Counting objects: 5, done. remote: Compressing objects: 100% (3/3), done. remote: Total 3 (delta 0), reused 0 (delta 0) Unpacking objects: 100% (3/3), done. From /home/madduck/.tmp/cdt.SLg15374/wc/../repo 8ccd80a..cba76e8 master -> origin/master Updating 8ccd80a..cba76e8 foo/a: needs update Fast forward 0 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 foo/bar/a % ls a foo % git status # On branch master # Changed but not updated: # (use "git add/rm <file>..." to update what will be committed) # # deleted: bar/a # # Untracked files: # (use "git add <file>..." to include in what will be committed) # # foo/ no changes added to commit (use "git add" and/or "git commit -a") % git diff diff --git a/foo/bar/a b/foo/bar/a deleted file mode 100644 index e69de29..0000000 -- martin | http://madduck.net/ | http://two.sentenc.es/ micro$oft windoze: proof that p. t. barnum was correct. spamtraps: madduck.bogus@xxxxxxxxxxx
Attachment:
digital_signature_gpg.asc
Description: Digital signature (see http://martin-krafft.net/gpg/)