From: Dmitry Potapov <dpotapov@gmail.com>
To: Mario Pareja <mpareja.dev@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Locking binary files
Date: Tue, 23 Sep 2008 17:44:46 +0400 [thread overview]
Message-ID: <20080923134446.GM21650@dpotapov.dyndns.org> (raw)
In-Reply-To: <94c1db200809222339t7d65081eq7471fef86fb5ec73@mail.gmail.com>
On Tue, Sep 23, 2008 at 02:39:41AM -0400, Mario Pareja wrote:
>
> How else can one developer be sure that time spent editing a
> binary file will not be wasted because another developer submitted a
> change?
That sounds to me more like a communication problem than anything
related to Git itself.
>
> To achieve the effects of locking, a "central" repository must be
> identified. Regardless of the distributed nature of git, most
> _companies_ will have a "central" repository for a software project.
> We should be able to mark a file as requiring a lock from the
> governing git repository at a specified address. Is this made
> difficult because git tracks file contents not files?
The problem exists regardless the distributed nature of git. Let's
consider a single repository with only two branches: A and B. Now, one
developer has decided to edit some binary file called pretty.img on A.
Should this file be locked only on the branch A or on both branches? The
answer is if A is going to merge to B then this file on B too and remain
locking till A is merged to B. In fact, it may be *absolutely* pointless
to lock the file on the developer's topic branch, because another
developer can edit it on another topic branch without noticing that this
lock exists at all. So, it may be enough to lock it only B enough, but
this is impossible to Git to know, because Git does not understand
_your_ particular workflow, and without any locking scheme is rather
meaningless.
Perhaps, a more general solution can be based exactly on the content,
not on the name, i.e. in some share directory on the server I create
a file with name based on SHA-1 of the binary file where I put comment
explaining why I locked it. Obviously, this lock is purely advisory,
but it is good, in some situation you really may want to edit two
files with the same SHA-1 on different branches that never get merge.
Moreover, this lock is never deleted. So, it could make sense instead
of having a separate file per lock to organize it in some more compact
storage, which may look like history of editing binary files... But it
is just an idea how I would do that.
Dmitry
prev parent reply other threads:[~2008-09-23 13:46 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <94c1db200809222333q4953a6b9g8ce0c1cd4b8f5eb4@mail.gmail.com>
2008-09-23 6:39 ` Locking binary files Mario Pareja
2008-09-23 7:18 ` Andreas Ericsson
[not found] ` <94c1db200809230054t20e7e61dh5022966d4112eee6@mail.gmail.com>
2008-09-23 8:31 ` Andreas Ericsson
2008-09-23 13:56 ` Mario Pareja
2008-09-23 14:28 ` Alex Riesen
2008-09-23 17:32 ` Daniel Barkalow
2008-09-23 19:49 ` Junio C Hamano
2008-09-23 21:13 ` Daniel Barkalow
2008-09-23 21:54 ` Dmitry Potapov
2008-09-23 22:29 ` Daniel Barkalow
2008-09-23 23:21 ` Dmitry Potapov
2008-09-24 4:15 ` Daniel Barkalow
2008-09-24 15:00 ` Dmitry Potapov
2008-09-23 20:46 ` Dmitry Potapov
2008-09-23 11:16 ` Boaz Harrosh
2008-09-23 11:20 ` Boaz Harrosh
2008-09-23 14:14 ` Mario Pareja
2008-09-23 14:35 ` Boaz Harrosh
2008-09-23 13:44 ` Dmitry Potapov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080923134446.GM21650@dpotapov.dyndns.org \
--to=dpotapov@gmail.com \
--cc=git@vger.kernel.org \
--cc=mpareja.dev@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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 NNTP newsgroup(s).