From: "martin f. krafft" <madduck@madduck.net>
To: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Cc: "Björn Steinbrink" <B.Steinbrink@gmx.de>
Subject: Re: [PATCH] Export GIT_DIR after setting it
Date: Tue, 20 May 2008 17:17:00 +0100 [thread overview]
Message-ID: <20080520161700.GA16629@lapse.madduck.net> (raw)
In-Reply-To: <7vod78i9r7.fsf@gitster.siamese.dyndns.org>
[-- Attachment #1: Type: text/plain, Size: 3294 bytes --]
also sprach Junio C Hamano <gitster@pobox.com> [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@madduck.net
[-- Attachment #2: Digital signature (see http://martin-krafft.net/gpg/) --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
prev parent reply other threads:[~2008-05-20 16:18 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-14 23:23 [PATCH] Export GIT_DIR after setting it martin f. krafft
2008-05-15 2:25 ` Junio C Hamano
2008-05-15 10:15 ` martin f. krafft
2008-05-15 17:23 ` Junio C Hamano
2008-05-15 17:55 ` Björn Steinbrink
2008-05-15 18:28 ` martin f. krafft
2008-05-15 18:44 ` Björn Steinbrink
2008-05-16 21:50 ` martin f. krafft
2008-05-20 16:17 ` martin f. krafft [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=20080520161700.GA16629@lapse.madduck.net \
--to=madduck@madduck.net \
--cc=B.Steinbrink@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/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).