From: Pascal Obry <pascal@obry.net>
To: Holger Hellmuth <hellmuth@ira.uka.de>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: How to deal with mixed tree?
Date: Tue, 22 Nov 2011 15:20:39 +0100 [thread overview]
Message-ID: <4ECBAFB7.9040505@obry.net> (raw)
In-Reply-To: <4ECB8917.8010305@ira.uka.de>
Holger,
> Remove SD in P1, make a logical link from P2 to SD, add SD to
> .git/info/exclude
Thanks for your quick reply. That's what I have tested but...
> (see "Bug report - local (and git ignored) file silently removed after
> checkout" on the mailing list why exclude is better than .gitignore at
> the moment)
Seems like this is working only if file names are different. This is not
my case as the replacement is very similar. With the following script
I'm expecting empty status and no diff:
<<
#!/bin/sh
# create sd (directory that will replace src2)
mkdir sd
echo sd1 > sd/file1
echo sd2 > sd/file2
# create Git repo
mkdir repo
cd repo
git init
mkdir src1
mkdir src2
echo file > src1/file
echo 3 > src2/file3
git add .
git ci -a -m "first"
# let's replace src2 by sd
rm -fr src2
# ln -s ../sd src2
cp -r ../sd src2
# make sure src2 is excluded
echo 'src2/*' >> .git/info/exclude
# the following output should be clean
echo '============== Status'
git status
echo '============== Diff'
git diff
>>
But the output is actually:
Initialized empty Git repository in /home/obry/tmp/repo/.git/
[master (root-commit) 527c7a1] first
2 files changed, 2 insertions(+), 0 deletions(-)
create mode 100644 src1/file
create mode 100644 src2/file3
cp: cannot stat `../src': No such file or directory
============== Status
# On branch master
# Changes not staged for commit:
# (use "git add/rm <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working
directory)
#
# deleted: src2/file3
#
no changes added to commit (use "git add" and/or "git commit -a")
============== Diff
diff --git a/src2/file3 b/src2/file3
deleted file mode 100644
index 00750ed..0000000
--- a/src2/file3
+++ /dev/null
@@ -1 +0,0 @@
-3
Any other idea?
Thanks.
--
--|------------------------------------------------------
--| Pascal Obry Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--| http://www.obry.net - http://v2p.fr.eu.org
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver keys.gnupg.net --recv-key F949BD3B
next prev parent reply other threads:[~2011-11-22 14:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-22 11:21 How to deal with mixed tree? Pascal Obry
2011-11-22 11:35 ` Holger Hellmuth
2011-11-22 14:20 ` Pascal Obry [this message]
2011-11-22 15:08 ` Holger Hellmuth
2011-11-22 15:21 ` Pascal Obry
2011-11-22 16:14 ` Holger Hellmuth
2011-11-22 17:29 ` Pascal Obry
2011-11-22 18:29 ` Junio C Hamano
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=4ECBAFB7.9040505@obry.net \
--to=pascal@obry.net \
--cc=git@vger.kernel.org \
--cc=hellmuth@ira.uka.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).