{"thread":{"id":"16039","subject":"Problem with git filter-branch","startedAt":"2008-10-25T09:33:12Z","lastAt":"2008-10-26T05:07:06Z","messageCount":5,"participants":["Pascal Obry","Johannes Schindelin","Mike Hommey","Jeff King"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"93916","messageId":"4902E7D8.6050401@obry.net","threadId":"16039","inReplyTo":null,"subject":"Problem with git filter-branch","fromName":"Pascal Obry","fromEmail":"pascal@obry.net","sentAt":"2008-10-25T09:33:12Z","receivedAt":"2008-10-25T09:33:12Z","isPatch":false,"sender":{"key":"pascal@obry.net","avatar":"https://avatars.githubusercontent.com/u/467069?v=4"},"body":"\nI'm using Git svn but I do not think this matters.\n\nI'm used to add manually some branches from the Subversion repository. I\nusually fetch the branch without following the parent then connect the\nbranch to the proper branch point (I really need to do this as the\nSubversion repository structure is not following the standard layout).\n\nAnyway, I used to run the following command:\n\n$ git filter-branch --tag-name-filter cat --parent-filter \"sed -e\n's/^$/-p c96d4da294667de1800687d25340551683153002/'\" svn-release_2_6\n\nwithout problem, I now get this:\n\nNamespace refs/original/ not empty\nrm: cannot remove directory\n`/home/obry/dev/repositories/git/proj/.git-rewrite': Directory not empty\n\nThe .git-rewrite is empty and when the command return I can do:\n\n$ rmdir .git-rewrite\n\nwithout problem.\n\nIs this is known issue? Any idea?\n\nThanks,\nPascal.\n\n-- \n\n--|------------------------------------------------------\n--| Pascal Obry                           Team-Ada Member\n--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE\n--|------------------------------------------------------\n--|              http://www.obry.net\n--| \"The best way to travel is by means of imagination\"\n--|\n--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595\n"},{"id":"93941","messageId":"alpine.DEB.1.00.0810252235040.22125@pacific.mpi-cbg.de.mpi-cbg.de","threadId":"16039","inReplyTo":"4902E7D8.6050401@obry.net","subject":"Re: Problem with git filter-branch","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-10-25T20:36:26Z","receivedAt":"2008-10-25T20:36:26Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sat, 25 Oct 2008, Pascal Obry wrote:\n\n> Anyway, I used to run the following command:\n> \n> $ git filter-branch --tag-name-filter cat --parent-filter \"sed -e\n> 's/^$/-p c96d4da294667de1800687d25340551683153002/'\" svn-release_2_6\n> \n> without problem, I now get this:\n> \n> Namespace refs/original/ not empty\n> rm: cannot remove directory\n> `/home/obry/dev/repositories/git/proj/.git-rewrite': Directory not empty\n\nIt is a (maybe ill-conceived) feature.  When branches are rewritten, their \noriginal versions are stored in the refs/original/ namespace.  You can \nforce overwriting with \"-f\".\n\nI wonder if people would like to have this feature removed; reflogs should \nbe enough.\n\nThoughts?\n\nCiao,\nDscho\n"},{"id":"93943","messageId":"20081025204012.GA26295@glandium.org","threadId":"16039","inReplyTo":"alpine.DEB.1.00.0810252235040.22125@pacific.mpi-cbg.de.mpi-cbg.de","subject":"Re: Problem with git filter-branch","fromName":"Mike Hommey","fromEmail":"mh@glandium.org","sentAt":"2008-10-25T20:40:12Z","receivedAt":"2008-10-25T20:40:12Z","isPatch":false,"sender":{"key":"mh@glandium.org","avatar":"https://avatars.githubusercontent.com/u/1038527?v=4"},"body":"On Sat, Oct 25, 2008 at 10:36:26PM +0200, Johannes Schindelin wrote:\n> Hi,\n> \n> On Sat, 25 Oct 2008, Pascal Obry wrote:\n> \n> > Anyway, I used to run the following command:\n> > \n> > $ git filter-branch --tag-name-filter cat --parent-filter \"sed -e\n> > 's/^$/-p c96d4da294667de1800687d25340551683153002/'\" svn-release_2_6\n> > \n> > without problem, I now get this:\n> > \n> > Namespace refs/original/ not empty\n> > rm: cannot remove directory\n> > `/home/obry/dev/repositories/git/proj/.git-rewrite': Directory not empty\n> \n> It is a (maybe ill-conceived) feature.  When branches are rewritten, their \n> original versions are stored in the refs/original/ namespace.  You can \n> force overwriting with \"-f\".\n> \n> I wonder if people would like to have this feature removed; reflogs should \n> be enough.\n\nI have never have had use for the refs/original namespace, and I used\nfilter-branch more than a couple of times. Though I would certainly\nunderstand that people would not be confident enough not to have a\nparachute. Reflog would indeed be enough, as long as it is not\nbranch@{42000} that needs to be used. Haven't checked, but theorically,\nit should be branch@{1} in all cases, so no problem here.\n\nMike\n"},{"id":"93944","messageId":"490387AF.8080308@obry.net","threadId":"16039","inReplyTo":"alpine.DEB.1.00.0810252235040.22125@pacific.mpi-cbg.de.mpi-cbg.de","subject":"Re: Problem with git filter-branch","fromName":"Pascal Obry","fromEmail":"pascal@obry.net","sentAt":"2008-10-25T20:55:11Z","receivedAt":"2008-10-25T20:55:11Z","isPatch":false,"sender":{"key":"pascal@obry.net","avatar":"https://avatars.githubusercontent.com/u/467069?v=4"},"body":"\nHi Johannes,\n\n> It is a (maybe ill-conceived) feature.  When branches are rewritten, their \n> original versions are stored in the refs/original/ namespace.  You can \n> force overwriting with \"-f\".\n\nWorking fine indeed with -f option. What's strange is that it used to\nwork without the -f option. Would be nice to improve the error message\nin this specific case.\n\nAnyway, thanks a lot.\n\n-- \n\n--|------------------------------------------------------\n--| Pascal Obry                           Team-Ada Member\n--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE\n--|------------------------------------------------------\n--|              http://www.obry.net\n--| \"The best way to travel is by means of imagination\"\n--|\n--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595\n"},{"id":"93967","messageId":"20081026050706.GC21178@coredump.intra.peff.net","threadId":"16039","inReplyTo":"alpine.DEB.1.00.0810252235040.22125@pacific.mpi-cbg.de.mpi-cbg.de","subject":"Re: Problem with git filter-branch","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2008-10-26T05:07:06Z","receivedAt":"2008-10-26T05:07:06Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, Oct 25, 2008 at 10:36:26PM +0200, Johannes Schindelin wrote:\n\n> It is a (maybe ill-conceived) feature.  When branches are rewritten, their \n> original versions are stored in the refs/original/ namespace.  You can \n> force overwriting with \"-f\".\n> \n> I wonder if people would like to have this feature removed; reflogs should \n> be enough.\n> \n> Thoughts?\n\nI have always been annoyed by the refs/original namespace, and it\ncertainly makes explaining the common task of \"how do I get this blob\nout of my repo\" a bit more confusing.\n\nSo I would be happy to see it go, and the reflog mentioned in its place:\n\ndiff --git a/Documentation/git-filter-branch.txt b/Documentation/git-filter-branch.txt\nindex fed6de6..1e8e7b4 100644\n--- a/Documentation/git-filter-branch.txt\n+++ b/Documentation/git-filter-branch.txt\n@@ -43,4 +43,4 @@ rewriting published history.)\n Always verify that the rewritten version is correct: The original refs,\n-if different from the rewritten ones, will be stored in the namespace\n-'refs/original/'.\n+if different from the rewritten ones, will be available through the\n+reflog as <branch>@{1}.\n \n"}]}