git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Put part of working tree on another file-system.
@ 2007-12-05 13:44 Sergei Organov
  2007-12-05 15:34 ` Rogan Dawes
  0 siblings, 1 reply; 3+ messages in thread
From: Sergei Organov @ 2007-12-05 13:44 UTC (permalink / raw
  To: git

Hello,

I've a desire to put a sub-tree of my working tree into another
file-system. With CVS I've used symlink to achieve this. It works fine
with CVS as it doesn't care about directories and symlinks at all. I had
little hope it will work with GIT, but I've performed a test anyway. To
my surprise it almost worked, so I have a hope that maybe it's not that
difficult to support this. What do you think? Or maybe there is a
different way to achieve the goal with GIT?

The test has been performed in a clone of the git tree (my comments are
prefixed by "osv>"):

$ git status
# On branch master
nothing to commit (working directory clean)
$ mv gitweb ../ && ln -s ../gitweb .
$ git status
# On branch master
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#       gitweb
nothing added to commit but untracked files present (use "git add" to track)

osv> here GIT is slightly confused by the change of a directory to a
osv> symlink to a directory.

$ echo hehe >> gitweb/INSTALL
$ git status
# On branch master
# Changed but not updated:
#   (use "git add <file>..." to update what will be committed)
#
#       modified:   gitweb/INSTALL
#
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#       gitweb
no changes added to commit (use "git add" and/or "git commit -a")

osv> here confusion is more obvious as GIT reports modified file in an
osv> untracked directory.

$ git commit -a

Created commit 7470207: The commit
 1 files changed, 1 insertions(+), 0 deletions(-)
$ git status
# On branch master
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#       gitweb
nothing added to commit but untracked files present (use "git add" to track)

osv> surprisingly nothing very bad happened, -- GIT has commited the
osv> modified file just fine, and left the symlink unchanged.
 
$ git reset --hard HEAD^
HEAD is now at 7a4a2e1... Set OLD_ICONV on Cygwin.
[osv@fulcrum git]$ git status
# On branch master
# Changed but not updated:
#   (use "git add/rm <file>..." to update what will be committed)
#
#       deleted:    gitweb/README
#       deleted:    gitweb/git-favicon.png
#       deleted:    gitweb/git-logo.png
#       deleted:    gitweb/gitweb.css
#       deleted:    gitweb/gitweb.perl
#       deleted:    gitweb/test/Märchen
#       deleted:    gitweb/test/file with spaces
#       deleted:    gitweb/test/file+plus+sign
#
no changes added to commit (use "git add" and/or "git commit -a")

osv> Ooops, -- now things begin to be more seriously broken. The result
osv> is that GIT removed the symlink, created gitweb directory, and put
osv> only INSTALL file into it. The directory the symlink was pointing
osv> to has the rest of files but INSTALL.

$ git reset --hard HEAD
HEAD is now at 7a4a2e1... Set OLD_ICONV on Cygwin.
$ git status
# On branch master
nothing to commit (working directory clean)

osv> This is now as expected, -- GIT just re-populated the gitweb
osv> directory as there is no symlink anymore.

-- 
Sergei.

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

end of thread, other threads:[~2007-12-05 17:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-05 13:44 Put part of working tree on another file-system Sergei Organov
2007-12-05 15:34 ` Rogan Dawes
2007-12-05 17:07   ` Sergei Organov

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).