{"thread":{"id":"52624","subject":"git , submodules and remove from historic question","startedAt":"2020-01-13T09:41:43Z","lastAt":"2020-01-15T05:14:33Z","messageCount":2,"participants":["FIGADERE, LAURENT","Jonathan Nieder"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"389662","messageId":"HE1PR0202MB263439EFAE785201C61495ABE6350@HE1PR0202MB2634.eurprd02.prod.outlook.com","threadId":"52624","inReplyTo":"HE1PR0202MB2634CD91D2750E199098FACAE6350@HE1PR0202MB2634.eurprd02.prod.outlook.com","subject":"git , submodules and remove from historic question","fromName":"FIGADERE, LAURENT","fromEmail":"laurent.figadere@atos.net","sentAt":"2020-01-13T09:41:34Z","receivedAt":"2020-01-13T09:41:43Z","isPatch":false,"sender":{"key":"laurent.figadere@atos.net","avatar":null},"body":"Dear git community ,\n\nI am using git submodule features.\n\nSo, by example, I have a repository top which include a sub repository sub-repo.\n\nI would like to re-write the whole historic on the top repository without the sub-repo.\n\nI tried to use git-filter command but I have an issue on sub-repo.\n\nHere the commands and outputs:\n[10:27:42] $ git submodule\nd3fc420ee38babe74d6e3838b5b2a946ee551fa7 sub-repo (v1.0)\n\n[9:55:48] $ git filter-branch --index-filter 'git rm -rf --cached --ignore-unmatch sub-repo' --prune-empty --tag-name-filter cat -- --all\nRewrite 471a2c664466a364bfe5fdf774c7c0d7efe50396 (32/54) (3 seconds passed, remaining 2 predicted)    fatal: exec '--super-prefix= sub-repo/': cd to sub-repo' failed: No such file or directory\nerror: Submodule sub-repo' could not be updated.\nerror: Submodule ' sub-repo' cannot checkout new HEAD.\nCould not initialize the index\n\nWas somebody able to remove such historic from a top repository?\nThanks by advance for your help.\n\nKind Regards,\nLaurent FIGADERE\n\n"},{"id":"389800","messageId":"20200115051429.GB218782@google.com","threadId":"52624","inReplyTo":"HE1PR0202MB263439EFAE785201C61495ABE6350@HE1PR0202MB2634.eurprd02.prod.outlook.com","subject":"Re: git , submodules and remove from historic question","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2020-01-15T05:14:29Z","receivedAt":"2020-01-15T05:14:33Z","isPatch":false,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi!\n\nFIGADERE, LAURENT wrote:\n\n> I am using git submodule features.\n>\n> So, by example, I have a repository top which include a sub\n> repository sub-repo.\n>\n> I would like to re-write the whole historic on the top repository\n> without the sub-repo.\n>\n> I tried to use git-filter command but I have an issue on sub-repo.\n\nThanks for reporting.  This looks like a real bug.\n\n(Nowadays we encourage using https://github.com/newren/git-filter-repo\ninstead of filter-branch, but I'm interested because of the underlying\nissues this report might be revealing.)\n\nBy the way, what version of Git are you using (you can find out by\nrunning \"git version --build-options\")?  Do you have the\nsubmodule.recurse setting enabled?\n\n> Here the commands and outputs:\n> [10:27:42] $ git submodule\n> d3fc420ee38babe74d6e3838b5b2a946ee551fa7 sub-repo (v1.0)\n>\n> [9:55:48] $ git filter-branch --index-filter 'git rm -rf --cached --ignore-unmatch sub-repo' --prune-empty --tag-name-filter cat -- --all\n> Rewrite 471a2c664466a364bfe5fdf774c7c0d7efe50396 (32/54) (3 seconds passed, remaining 2 predicted)    fatal: exec '--super-prefix= sub-repo/': cd to sub-repo' failed: No such file or directory\n\nHm, I'm not able to reproduce this.  I tried using\n\n  git clone --recurse-submodules https://gerrit.googlesource.com/gerrit\n  cd gerrit\n  git filter-branch --index-filter \\\n    'git rm -rf --cached --ignore-unmatch plugins/hooks' \\\n    --prune-empty --tag-name-filter cat -- --all\n\nWhat is the output with the GIT_TRACE=1 environment variable set?\n\nThanks and hope that helps,\nJonathan\n"}]}