)]}'
{
  "commit": "08fc0608657ee91bc85276667804c36a93138c7d",
  "tree": "4727c50223b6301c49c2bb0b3e54c6927ce4377d",
  "parents": [
    "5832d1a9da78273652c213d8e1535c09dd7dc079"
  ],
  "author": {
    "name": "Marcel M. Cary",
    "email": "marcel@oak.homeunix.org",
    "time": "Mon Dec 15 09:34:37 2008 -0800"
  },
  "committer": {
    "name": "Junio C Hamano",
    "email": "gitster@pobox.com",
    "time": "Sun Dec 21 01:10:48 2008 -0800"
  },
  "message": "git-sh-setup: Fix scripts whose PWD is a symlink into a git work-dir\n\nI want directories of my working tree to be linked to from various\npaths on my filesystem where third-party components expect them, both\nin development and production environments.  A build system\u0027s install\nstep could solve this, but I develop scripts and web pages that don\u0027t\nneed to be built.  Git\u0027s submodule system could solve this, but we\ntend to develop, branch, and test those directories all in unison, so\none big repository feels more natural.  We prefer to edit and commit\non the symlinked paths, not the canonical ones, and in that setting,\n\"git pull\" fails to find the top-level directory of the repository\nwhile other commands work fine.\n\n\"git pull\" fails because POSIX shells have a notion of current working\ndirectory that is different from getcwd().  The shell stores this path\nin PWD.  As a result, \"cd ../\" can be interpreted differently in a\nshell script than chdir(\"../\") in a C program.  The shell interprets\n\"../\" by essentially stripping the last textual path component from\nPWD, whereas C chdir() follows the \"..\" link in the current directory\non the filesystem.  When PWD is a symlink, these are different\ndestinations.  As a result, Git\u0027s C commands find the correct\ntop-level working tree, and shell scripts do not.\n\nChanges:\n\n* When interpreting a relative upward (../) path in cd_to_toplevel,\n  prepend the cwd without symlinks, given by /bin/pwd\n* Add tests for cd_to_toplevel and \"git pull\" in a symlinked\n  directory that failed before this fix, plus contrasting scenarios\n  that already worked\n\nSigned-off-by: Marcel M. Cary \u003cmarcel@oak.homeunix.org\u003e\nSigned-off-by: Junio C Hamano \u003cgitster@pobox.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "dbdf209ec0e7d6468c199d1905c3e7788a9cd246",
      "old_mode": 33261,
      "old_path": "git-sh-setup.sh",
      "new_id": "f07d96b9b5e3997b21736893be39ce91950f4878",
      "new_mode": 33261,
      "new_path": "git-sh-setup.sh"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "beddb4e9f26cb3ade276825a204d950d3173d583",
      "new_mode": 33261,
      "new_path": "t/t2300-cd-to-toplevel.sh"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "5672b51e2ea8db0e080e95315b292c91480a0000",
      "new_mode": 33261,
      "new_path": "t/t5521-pull-symlink.sh"
    }
  ]
}
