# rev-parse's show-{cdup,prefix} inconsistent when pwd symlink

1 messages from 2019-07-07 to 2019-07-07. Participants: Oliver Ford.
Thread: https://gitlist.dev/t/51442

## Oliver Ford, 2019-07-07 15:36

Subject: rev-parse's show-{cdup,prefix} inconsistent when pwd symlink
Message-ID: <2cf30314-d9a3-4be3-80bf-46f283010e5d@www.fastmail.com>
URL: https://gitlist.dev/e/2cf30314-d9a3-4be3-80bf-46f283010e5d%40www.fastmail.com

```
`git rev-parse --show-prefix` gives the symlinked directory, not pwd:

ˋˋˋ
$ git init
Initialized empty Git repository in [~]/git-test/.git/
$ mkdir realdir
$ ln -s realdir symdir
$ cd symdir
$ pwd
[~]/misc/git-test/symdir
$ git rev-parse --show-prefix
realdir/
ˋˋˋ

That might arguably be desirable, (though not in my prompt) but I don't think this is:

ˋˋˋ
$ cd ..
$ mkdir realdir/2
$ ln -s realdir/2 symdir2
$ cd symdir2
$ pwd
[~]/misc/git-test/symdir2
$ git rev-parse --show-cdup
../../
ˋˋˋ

that is, `--show-cdup` gives a 'cd up' that is incorrect for where we actually are.


Apologies if I've just missed an option,

-- 
Oliver Ford

```
