All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergei Organov <osv@javad.com>
To: git@vger.kernel.org
Subject: Put part of working tree on another file-system.
Date: Wed, 05 Dec 2007 16:44:39 +0300	[thread overview]
Message-ID: <87mysp8ddk.fsf@osv.gnss.ru> (raw)

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.

             reply	other threads:[~2007-12-05 13:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-05 13:44 Sergei Organov [this message]
2007-12-05 15:34 ` Put part of working tree on another file-system Rogan Dawes
2007-12-05 17:07   ` Sergei Organov

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=87mysp8ddk.fsf@osv.gnss.ru \
    --to=osv@javad.com \
    --cc=git@vger.kernel.org \
    /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 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.