git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* intend-to-edit flag
@ 2013-07-04 17:56 Thomas Koch
  2013-07-04 18:10 ` Ævar Arnfjörð Bjarmason
  0 siblings, 1 reply; 4+ messages in thread
From: Thomas Koch @ 2013-07-04 17:56 UTC (permalink / raw)
  To: git

Hi,

we're evaluating Git to be used in our companies Tool. But a hard requirement 
is the possibility to set an "intend-to-edit" flag on a file (better path).
Notice that I did not use the word "lock"! :-)

One easy implementation might be a special branch "XYZ-locks" that contains an 
empty blob for every flagged file. So our tool just needs to check, whether a 
blob exists for the path that's intended to edit, tries to push a commit that 
touches the file and only allows editing if the push succeeds.

Does anybody have a better idea, maybe with notes?

Thank you,

Thomas Koch, http://www.koch.ro

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: intend-to-edit flag
  2013-07-04 17:56 intend-to-edit flag Thomas Koch
@ 2013-07-04 18:10 ` Ævar Arnfjörð Bjarmason
  2013-07-04 18:19   ` John Keeping
  2013-07-04 18:25   ` Thomas Koch
  0 siblings, 2 replies; 4+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2013-07-04 18:10 UTC (permalink / raw)
  To: thomas; +Cc: git

On Thu, Jul 4, 2013 at 7:56 PM, Thomas Koch <thomas@koch.ro> wrote:
> we're evaluating Git to be used in our companies Tool. But a hard requirement
> is the possibility to set an "intend-to-edit" flag on a file (better path).
> Notice that I did not use the word "lock"! :-)
>
> One easy implementation might be a special branch "XYZ-locks" that contains an
> empty blob for every flagged file. So our tool just needs to check, whether a
> blob exists for the path that's intended to edit, tries to push a commit that
> touches the file and only allows editing if the push succeeds.

In my experience everyone who thinks this is a hard requirement is
wrong.

Sure you can implement something to do this, but more likely than not
you think you need it because your current centralized SCM does it and
you think you can't live without it.

I work with a couple of hundred devs all grinding on the same
repository and it's really rare to have:

 * People who edit the same code within each other's pull/push window AND
 * Have the edits to those files not be smoothly resolved by automatic
   merging (i.e. because it was to completely different parts of the
   file).

When it does happen every once in a while it's trivial to solve it,
you just resolve conflicts, talk to the other guy etc.

Why don't you just start using Git and see if this becomes a practical
problem rather than devising some elaborate solution to work around
something that probably won't be an issue anyway?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: intend-to-edit flag
  2013-07-04 18:10 ` Ævar Arnfjörð Bjarmason
@ 2013-07-04 18:19   ` John Keeping
  2013-07-04 18:25   ` Thomas Koch
  1 sibling, 0 replies; 4+ messages in thread
From: John Keeping @ 2013-07-04 18:19 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: thomas, git

On Thu, Jul 04, 2013 at 08:10:07PM +0200, Ævar Arnfjörð Bjarmason wrote:
> On Thu, Jul 4, 2013 at 7:56 PM, Thomas Koch <thomas@koch.ro> wrote:
> > we're evaluating Git to be used in our companies Tool. But a hard requirement
> > is the possibility to set an "intend-to-edit" flag on a file (better path).
> > Notice that I did not use the word "lock"! :-)
> >
> > One easy implementation might be a special branch "XYZ-locks" that contains an
> > empty blob for every flagged file. So our tool just needs to check, whether a
> > blob exists for the path that's intended to edit, tries to push a commit that
> > touches the file and only allows editing if the push succeeds.
> 
> In my experience everyone who thinks this is a hard requirement is
> wrong.

I completely agree with this.

Having said that, if you're looking at using Gitolite (which you should
if you're hosing your own repositories and not using some other hosting
solution), there is a "lock" command [1].  Note that this cannot stop
you committing changes to "locked" files locally but it does stop you
pushing changes to the central repository that touch locked files.

[1] http://gitolite.com/gitolite/locking.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: intend-to-edit flag
  2013-07-04 18:10 ` Ævar Arnfjörð Bjarmason
  2013-07-04 18:19   ` John Keeping
@ 2013-07-04 18:25   ` Thomas Koch
  1 sibling, 0 replies; 4+ messages in thread
From: Thomas Koch @ 2013-07-04 18:25 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: git

On Thursday, July 04, 2013 08:10:07 PM Ævar Arnfjörð Bjarmason wrote:
> Why don't you just start using Git and see if this becomes a practical
> problem rather than devising some elaborate solution to work around
> something that probably won't be an issue anyway?

I've been giving talks about Git already in 2008. I know that we don't need 
locking. But my boss says we need it. - So he'll get it.

Thomas Koch, http://www.koch.ro

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-07-04 18:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-04 17:56 intend-to-edit flag Thomas Koch
2013-07-04 18:10 ` Ævar Arnfjörð Bjarmason
2013-07-04 18:19   ` John Keeping
2013-07-04 18:25   ` Thomas Koch

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).