git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Locking binary files

From
MPMario Pareja <mpareja.dev@gmail.com>
Date
Sep 23, 2008, 13:56 UTC
Message-ID
<94c1db200809230656q4a9a765dw2354c0058b1d940c@mail.gmail.com>
In-Reply-To
<48D8A97E.8070003@op5.se>
> So it's a communication issue then.

Yes, but I think the communication of this information needs to happen as part of a developers normal work-flow rather than requiring them to remember to check an external system.

> The way I understand locks in svn
> and cvs is that they also only bother you when you want to check in the
> file you've just recently modified, or if multiple people want to lock
> the same file at the same time.

The SVN client will make locked files read-only until a lock is obtained for them. This helps "remind" you that a lock should be obtained before editing such a file. Requiring the developer to obtain a lock ensures that nobody else is editing the file and prevents wasted work. Upon commit, the file is marked as unlocked and the local file is once again read-only.

>
> Note that locking would be completely advisory though, and nothing
> would prevent people from committing changes to a locked file.

If git were to support locking then it could prevent people from committing without first locking. Even if it is not supported directly by git - perhaps using a lock daemon - a wrapper would need to be written around git commit/push to prevent developers from committing/pushing changes that would cause binary merging conflicts.

Show 6 quoted lines
> Then
> again, insofar as I understand SVN/CVS locking, that's how those
> work too, except that an SVN "checkin" would be the equivalent of
> "git commit && git push" (the push part of the git sequence won't
> work).
>
Generally in SVN you need to lock the file before being able to commit.

Really, I am just curious about how others deal with this issue. Do you simply start editing binary files and hope nobody else edits the same file? Do you send out an email telling people you are working on such a file?

Mario
Previous: Andreas EricssonNext: Alex Riesen
Message 9 of 19 in “Re: Locking binary files”
  1. Mario ParejaSep 23, 2008
  2. Andreas EricssonSep 23, 2008
  3. Boaz HarroshSep 23, 2008
  4. Boaz HarroshSep 23, 2008
  5. Mario ParejaSep 23, 2008
  6. Boaz HarroshSep 23, 2008
  7. Dmitry PotapovSep 23, 2008
  8. Andreas EricssonSep 23, 2008
  9. Mario ParejaSep 23, 2008
  10. Alex RiesenSep 23, 2008
  11. Daniel BarkalowSep 23, 2008
  12. Junio C HamanoSep 23, 2008
  13. Daniel BarkalowSep 23, 2008
  14. Dmitry PotapovSep 23, 2008
  15. Daniel BarkalowSep 23, 2008
  16. Dmitry PotapovSep 23, 2008
  17. Daniel BarkalowSep 24, 2008
  18. Dmitry PotapovSep 24, 2008
  19. Dmitry PotapovSep 23, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.