{"thread":{"id":"34346","subject":"intend-to-edit flag","startedAt":"2013-07-04T17:56:40Z","lastAt":"2013-07-04T18:25:53Z","messageCount":4,"participants":["Thomas Koch","Ævar Arnfjörð Bjarmason","John Keeping"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"222575","messageId":"2240842.MQEMCLPV8Z@x121e","threadId":"34346","inReplyTo":null,"subject":"intend-to-edit flag","fromName":"Thomas Koch","fromEmail":"thomas@koch.ro","sentAt":"2013-07-04T17:56:40Z","receivedAt":"2013-07-04T17:56:40Z","isPatch":false,"sender":{"key":"thomas@koch.ro","avatar":null},"body":"Hi,\n\nwe're evaluating Git to be used in our companies Tool. But a hard requirement \nis the possibility to set an \"intend-to-edit\" flag on a file (better path).\nNotice that I did not use the word \"lock\"! :-)\n\nOne easy implementation might be a special branch \"XYZ-locks\" that contains an \nempty blob for every flagged file. So our tool just needs to check, whether a \nblob exists for the path that's intended to edit, tries to push a commit that \ntouches the file and only allows editing if the push succeeds.\n\nDoes anybody have a better idea, maybe with notes?\n\nThank you,\n\nThomas Koch, http://www.koch.ro\n"},{"id":"222576","messageId":"CACBZZX5tj0EpV7rv6FymSJunPY-Hs1fJrAmmAOnbEb9WKykmYg@mail.gmail.com","threadId":"34346","inReplyTo":"2240842.MQEMCLPV8Z@x121e","subject":"Re: intend-to-edit flag","fromName":"Ævar Arnfjörð Bjarmason","fromEmail":"avarab@gmail.com","sentAt":"2013-07-04T18:10:07Z","receivedAt":"2013-07-04T18:10:07Z","isPatch":false,"sender":{"key":"avarab@gmail.com","avatar":"https://avatars.githubusercontent.com/u/45301?v=4"},"body":"On Thu, Jul 4, 2013 at 7:56 PM, Thomas Koch <thomas@koch.ro> wrote:\n> we're evaluating Git to be used in our companies Tool. But a hard requirement\n> is the possibility to set an \"intend-to-edit\" flag on a file (better path).\n> Notice that I did not use the word \"lock\"! :-)\n>\n> One easy implementation might be a special branch \"XYZ-locks\" that contains an\n> empty blob for every flagged file. So our tool just needs to check, whether a\n> blob exists for the path that's intended to edit, tries to push a commit that\n> touches the file and only allows editing if the push succeeds.\n\nIn my experience everyone who thinks this is a hard requirement is\nwrong.\n\nSure you can implement something to do this, but more likely than not\nyou think you need it because your current centralized SCM does it and\nyou think you can't live without it.\n\nI work with a couple of hundred devs all grinding on the same\nrepository and it's really rare to have:\n\n * People who edit the same code within each other's pull/push window AND\n * Have the edits to those files not be smoothly resolved by automatic\n   merging (i.e. because it was to completely different parts of the\n   file).\n\nWhen it does happen every once in a while it's trivial to solve it,\nyou just resolve conflicts, talk to the other guy etc.\n\nWhy don't you just start using Git and see if this becomes a practical\nproblem rather than devising some elaborate solution to work around\nsomething that probably won't be an issue anyway?\n"},{"id":"222577","messageId":"20130704181911.GJ9161@serenity.lan","threadId":"34346","inReplyTo":"CACBZZX5tj0EpV7rv6FymSJunPY-Hs1fJrAmmAOnbEb9WKykmYg@mail.gmail.com","subject":"Re: intend-to-edit flag","fromName":"John Keeping","fromEmail":"john@keeping.me.uk","sentAt":"2013-07-04T18:19:11Z","receivedAt":"2013-07-04T18:19:11Z","isPatch":false,"sender":{"key":"john@keeping.me.uk","avatar":"https://avatars.githubusercontent.com/u/1702081?v=4"},"body":"On Thu, Jul 04, 2013 at 08:10:07PM +0200, Ævar Arnfjörð Bjarmason wrote:\n> On Thu, Jul 4, 2013 at 7:56 PM, Thomas Koch <thomas@koch.ro> wrote:\n> > we're evaluating Git to be used in our companies Tool. But a hard requirement\n> > is the possibility to set an \"intend-to-edit\" flag on a file (better path).\n> > Notice that I did not use the word \"lock\"! :-)\n> >\n> > One easy implementation might be a special branch \"XYZ-locks\" that contains an\n> > empty blob for every flagged file. So our tool just needs to check, whether a\n> > blob exists for the path that's intended to edit, tries to push a commit that\n> > touches the file and only allows editing if the push succeeds.\n> \n> In my experience everyone who thinks this is a hard requirement is\n> wrong.\n\nI completely agree with this.\n\nHaving said that, if you're looking at using Gitolite (which you should\nif you're hosing your own repositories and not using some other hosting\nsolution), there is a \"lock\" command [1].  Note that this cannot stop\nyou committing changes to \"locked\" files locally but it does stop you\npushing changes to the central repository that touch locked files.\n\n[1] http://gitolite.com/gitolite/locking.html\n"},{"id":"222578","messageId":"2219205.N0GPDDeFOM@x121e","threadId":"34346","inReplyTo":"CACBZZX5tj0EpV7rv6FymSJunPY-Hs1fJrAmmAOnbEb9WKykmYg@mail.gmail.com","subject":"Re: intend-to-edit flag","fromName":"Thomas Koch","fromEmail":"thomas@koch.ro","sentAt":"2013-07-04T18:25:53Z","receivedAt":"2013-07-04T18:25:53Z","isPatch":false,"sender":{"key":"thomas@koch.ro","avatar":null},"body":"On Thursday, July 04, 2013 08:10:07 PM Ævar Arnfjörð Bjarmason wrote:\n> Why don't you just start using Git and see if this becomes a practical\n> problem rather than devising some elaborate solution to work around\n> something that probably won't be an issue anyway?\n\nI've been giving talks about Git already in 2008. I know that we don't need \nlocking. But my boss says we need it. - So he'll get it.\n\nThomas Koch, http://www.koch.ro\n"}]}