{"thread":{"id":"13171","subject":"Re: git svn should refuse to checkin .svn directories","startedAt":"2008-04-18T11:46:50Z","lastAt":"2008-04-19T18:49:33Z","messageCount":3,"participants":["JM Ibanez","Thomas Koch","Jānis Rūcis"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"74736","messageId":"200804181346.50755.thomas@koch.ro","threadId":"13171","inReplyTo":null,"subject":"git svn should refuse to checkin .svn directories","fromName":"Thomas Koch","fromEmail":"thomas@koch.ro","sentAt":"2008-04-18T11:46:50Z","receivedAt":"2008-04-18T11:46:50Z","isPatch":false,"sender":{"key":"thomas@koch.ro","avatar":null},"body":"As you might guess I just annoyed my collegues by (temporarily) destroying our \nsvn repo. Nobody could checkout anymore, because I accidently checked in \na .svn directory with git svn.\n\nI'm lucky that I'm still allowed to use git svn to work on our svn repo...\n\nMaybe you could add a warning or something else to avoid .svn directories to \nbe ever checked in via git svn.\n\nI'm sure that there is also a config option somewhere to get .svn directories \nignored (also subdirs when adding the parent dir?). But this check should \nreally be a default setting to avoid other newcommers to get into trouble \nbecause they gave git svn a try.\n\n\nCheers,\n-- \nThomas Koch, Software Developer\nhttp://www.koch.ro\n"},{"id":"74722","messageId":"873apian0t.fsf@armitage.orangeandbronze.local","threadId":"13171","inReplyTo":"200804181346.50755.thomas@koch.ro","subject":"Re: git svn should refuse to checkin .svn directories","fromName":"JM Ibanez","fromEmail":"jm@orangeandbronze.com","sentAt":"2008-04-18T21:09:06Z","receivedAt":"2008-04-18T21:09:06Z","isPatch":false,"sender":{"key":"jm@orangeandbronze.com","avatar":null},"body":"Thomas Koch <thomas@koch.ro> writes:\n\n> As you might guess I just annoyed my collegues by (temporarily) destroying our \n> svn repo. Nobody could checkout anymore, because I accidently checked in \n> a .svn directory with git svn.\n>\n> I'm lucky that I'm still allowed to use git svn to work on our svn repo...\n>\n> Maybe you could add a warning or something else to avoid .svn directories to \n> be ever checked in via git svn.\n>\n> I'm sure that there is also a config option somewhere to get .svn directories \n> ignored (also subdirs when adding the parent dir?). But this check should \n> really be a default setting to avoid other newcommers to get into trouble \n> because they gave git svn a try.\n\nWell, this isn't a patch to git-svn, but this may help those working\nwith upstream SVN repositories via git and git-svn. Add this as the\npre-commit hook in .git/hooks (make sure to make it executable).\n\n\n\n#!/bin/sh\n#\n# Used in a git repo interacting with an upstream SVN repo, this\n# pre-commit hook will not allow a commit of any directory named .svn\n\n\nif (git diff-index HEAD | cut -f2 | grep \"^\\(.*/\\)*\\.svn/\" 2>&1 > /dev/null); then\n    echo \"Cowardly refusing to commit an .svn directory\"\n    exit 1\nfi\n\n    \n\n\n\n\n-- \nJM Ibanez\nSoftware Architect\nOrange & Bronze Software Labs, Ltd. Co.\n\njm@orangeandbronze.com\nhttp://software.orangeandbronze.com/\n"},{"id":"74764","messageId":"20080419184933.GA9724@localhost.localdomain","threadId":"13171","inReplyTo":"200804181346.50755.thomas@koch.ro","subject":"Re: git svn should refuse to checkin .svn directories","fromName":"Jānis Rūcis","fromEmail":"parasti@gmail.com","sentAt":"2008-04-19T18:49:33Z","receivedAt":"2008-04-19T18:49:33Z","isPatch":false,"sender":{"key":"parasti@gmail.com","avatar":null},"body":"Hi,\n\nOn Fri, Apr 18, 2008 at 01:46:50PM +0200, Thomas Koch wrote:\n> I'm sure that there is also a config option somewhere to get .svn directories \n> ignored (also subdirs when adding the parent dir?). But this check should \n> really be a default setting to avoid other newcommers to get into trouble \n> because they gave git svn a try.\n\nPerhaps it would help if you clarified why there are .svn directories in\nyour working copy.  They are neither required nor created by git-svn.\n\nJānis\n"}]}