)]}'
{
  "commit": "61b472ed8b090a3e9240590c85041120a54dd268",
  "tree": "702bfe54576b1051c622dc5a20740695985d66e4",
  "parents": [
    "e48fb750f579f993062e0e5901e70bd7ddfc94b8"
  ],
  "author": {
    "name": "Peter Baumann",
    "email": "waste.manager@gmx.de",
    "time": "Thu Aug 09 08:42:53 2012 +0200"
  },
  "committer": {
    "name": "Eric Wong",
    "email": "normalperson@yhbt.net",
    "time": "Fri Aug 10 19:53:18 2012 +0000"
  },
  "message": "git svn: reset invalidates the memoized mergeinfo caches\n\nSince v1.7.0-rc2~11 (git-svn: persistent memoization, 2010-01-30),\ngit-svn has maintained some private per-repository caches in\n.git/svn/.caches to avoid refetching and recalculating some\nmergeinfo-related information with every \u0027git svn fetch\u0027.\n\nThis memoization can cause problems, e.g consider the following case:\n\nSVN repo:\n\n  ... - a - b - c - m  \u003c- trunk\n          \\        /\n            d  -  e    \u003c- branch1\n\nThe Git import of the above repo is at commit \u0027a\u0027 and doesn\u0027t know about\nthe branch1. In case of an \u0027git svn rebase\u0027, only the trunk of the\nSVN repo is imported. During the creation of the git commit \u0027m\u0027, git svn\nuses the svn:mergeinfo property and tries to find the corresponding git\ncommit \u0027e\u0027 to create \u0027m\u0027 with \u0027c\u0027 and \u0027e\u0027 as parents. But git svn rebase\nonly imports the current branch so commit \u0027e\u0027 is not imported.\nTherefore git svn fails to create commit \u0027m\u0027 as a merge commit, because one\nof its parents is not known to git. The imported history looks like this:\n\n  ... - a - b - c - m  \u003c- trunk\n\nA later \u0027git svn fetch\u0027 to import all branches can\u0027t rewrite the commit \u0027m\u0027\nto add \u0027e\u0027 as a parent and to make it a real git merge commit, because it\nwas already imported.\n\nThat\u0027s why the imported history misses the merge and looks like this:\n\n  ... - a - b - c - m  \u003c- trunk\n          \\\n            d  -  e    \u003c- branch1\n\nRight now the only known workaround for importing \u0027m\u0027 as a merge is to\nforce reimporting \u0027m\u0027 again from SVN, e.g. via\n\n  $ git svn reset --revision $(git find-rev $c)\n  $ git svn fetch\n\nSadly, this is where the behavior has regressed: git svn reset doesn\u0027t\ninvalidate the old mergeinfo cache, which is no longer valid for the\nreimport, which leads to \u0027m\u0027 beeing imprted with only \u0027c\u0027 as parent.\n\nAs solution to this problem, this commit invalidates the mergeinfo cache\nto force correct recalculation of the parents.\n\nDuring development of this patch, several ways for invalidating the cache\nwhere considered. One of them is to use Memoize::flush_cache, which will\ncall the CLEAR method on the underlying Memoize persistency implementation.\nSadly, neither Memoize::Storable nor the newer Memoize::YAML module\nintroduced in 68f532f4ba888 could optionally be used implement the\nCLEAR method, so this is not an option.\n\nReseting the internal hash used to store the memoized values has the same\nproblem, because it calls the non-existing CLEAR method of the\nunderlying persistency layer, too.\n\nConsidering this and taking into account the different implementations\nof the memoization modules, where Memoize::Storable is not in our control,\nimplementing the missing CLEAR method is not an option, at least not if\nMemoize::Storable is still used.\n\nTherefore the easiest solution to clear the cache is to delete the files\non disk in \u0027git svn reset\u0027. Normally, deleting the files behind the back\nof the memoization module would be problematic, because the in-memory\nrepresentation would still exist and contain wrong data. Fortunately, the\nmemoization is active in memory only for a small portion of the code.\nInvalidating the cache by deleting the files on disk if it isn\u0027t active\nshould be safe.\n\nSigned-off-by: Peter Baumann \u003cwaste.manager@gmx.de\u003e\nSigned-off-by: Steven Walter \u003cstevenrwalter@gmail.com\u003e\nSigned-off-by: Eric Wong \u003cnormalperson@yhbt.net\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "b8b34744ea49df95196cfb7ef0566f6ced57ba6b",
      "old_mode": 33188,
      "old_path": "perl/Git/SVN.pm",
      "new_id": "8478d0c95293b531547084e19b6680cf73187469",
      "new_mode": 33188,
      "new_path": "perl/Git/SVN.pm"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "cd4c662ba21cdc460254ccd4901fdea5a41de982",
      "new_mode": 33261,
      "new_path": "t/t9163-git-svn-reset-clears-caches.sh"
    }
  ]
}
