summaryrefslogtreecommitdiff
path: root/doc/bugs/git_rename_detection_on_file_move/comment_2_7101d07400ad5935f880dc00d89bf90e._comment
blob: 7d50c58d1b104c2d12a276ceee9f88026512a12d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
[[!comment format=mdwn
 username="praet"
 ip="81.240.159.215"
 subject="Use variable symlinks, relative to the repo's root ?"
 date="2011-03-10T16:50:28Z"
 content="""
It all boils down to the fact that the path to a relative symlink's target is determined relative to the symlink itself.

Now, if we define the symlink's target relative to the git repo's root (eg. using the $GIT_DIR environment variable, which can be a relative or absolute path itself), this unfortunately results in an absolute symlink, which would -for obvious reasons- only be usable locally:

    user@host:~$ mkdir -p tmp/{.git/annex,somefolder}
    user@host:~$ export GIT_DIR=~/tmp
    user@host:~$ touch $GIT_DIR/.git/annex/realfile
    user@host:~$ ln -s $GIT_DIR/.git/annex/realfile $GIT_DIR/somefolder/file
    user@host:~$ ls -al $GIT_DIR/somefolder/
    total 12
    drwxr-x--- 2 user group 4096 2011-03-10 16:54 .
    drwxr-x--- 4 user group 4096 2011-03-10 16:53 ..
    lrwxrwxrwx 1 user group   33 2011-03-10 16:54 file -> /home/user/tmp/.git/annex/realfile
    user@host:~$

So, what we need is the ability to record the actual variable name (instead of it's value) in our symlinks.

It *is* possible, using [variable/variant symlinks](http://en.wikipedia.org/wiki/Symbolic_link#Variable_symbolic_links), yet I'm unsure as to whether or not this is available on Linux systems, and even if it is, it would introduce compatibility issues in multi-OS environments.

Thoughts on this?
"""]]