News for hackers. Stuff that matters.
Re:Is Git Irreplaceable? (2019) by rhabarba on Monday January 06, 2020 @08:02PM (#21975582)
> I don't see any obvious flaws with Git.

Merge conflicts.

Re:Is Git Irreplaceable? (2019) by hn_acc_1 on Monday January 06, 2020 @08:47PM (#21975891)
Merge conflicts are not so scary, and are an elegant way to handle distributed changes with simultaneous edits to a single file.

If the conflict is huge, rebasing can help you by "playing" the commits from one branch one at a time so the conflicts are smaller / easier to fix.

At a previous job, a team was forced to use checkout-style VCS due to their manager's unfounded fear of merge conflicts; I couldn't go in that office without hearing one developer shout to another: "Hey, can you finish up and check in that file so I can get started on my changes?"

Re:Is Git Irreplaceable? (2019) by hinkley on Tuesday January 07, 2020 @02:03AM (#21977683)
I’ve spent too much time helping others fix bad merges, and I still catch myself making mistakes. There’s a lot of work that could be done for clarity and error avoidance.
Re:Is Git Irreplaceable? (2019) by rhabarba on Monday January 06, 2020 @08:55PM (#21975936)
Sounds like something that would have been solved by using Darcs instead, honestly.
Re:Is Git Irreplaceable? (2019) by james_s_tayler on Tuesday January 07, 2020 @12:43AM (#21977263)
No VCS will be merge conflict-less without locking files.

I'd rather not lock files.

Re:Is Git Irreplaceable? (2019) by ben509 on Tuesday January 07, 2020 @10:49AM (#21981056)
I'd rather lock files, but be able to unlock them, to be able to coordinate with others and proactively reduce merge conflicts.
Re:Is Git Irreplaceable? (2019) by wyoung2 on Tuesday January 07, 2020 @11:03AM (#21981201)
The only way to make that simple is to centralize the version control system so that you can have a single arbiter of who has what locked. To add easy locking to Git, you'd have to turn it back into a non-distributed VCS.

I don't think I need to sell the value of DVCS over VCS, but what seems to get lost is that buys you a certain amount of essential complexity, expressed in the CAP theorem and its consequences.

We discussed this deeply on the Fossil forum: https://www.fossil-scm.org/forum/forumpost/2afc32b1ab

We came to no easy answers, because there aren't any. You only get a choice of which problems to accept.

Re:Is Git Irreplaceable? (2019) by ben509 on Wednesday January 08, 2020 @05:01PM (#21996259)
I'm talking about purely advisory locks. Accessing a locked file would let you know who locked it, and if you unlock it, it would just notify them. So it's just a communications mechanism in addition to regular merges.

The alternate method is that locking a file marks you as an interested party to a merge, allowing you to review the correctness of a merge.

This would be purely to avoid changes being lost during merges.

Re:Is Git Irreplaceable? (2019) by thenewnewguy on Monday January 06, 2020 @09:01PM (#21975979)
Merge conflicts are a part of any VCS that allows two people to edit the same file at the same time.
Re:Is Git Irreplaceable? (2019) by HALtheWise on Tuesday January 07, 2020 @12:27AM (#21977186)
However, in some cases (like non-mergeable binary files), it is actually better to have a system that allows one user to take a lock on a file and have exclusive editing abilities. The git protocol has no support for those workflows, and so people end up using a Google Doc or something to track who is modifying what file. Definately a place for improvement.
Re:Is Git Irreplaceable? (2019) by shakna on Tuesday January 07, 2020 @02:13AM (#21977735)
How do you lock a file in a distributed system? Many people won't be online. Many people won't be on the exact same head.
Re:Is Git Irreplaceable? (2019) by squiggleblaz on Tuesday January 07, 2020 @05:58AM (#21978827)
> Many people won't be on the exact same head.

This consideration is actually irrelevant to locking non-mergeable binary files. It doesn't matter what branch we're on or where the file is located, only that you and I both want to edit the logo. Eventually, either your version must be based on mine, or mine based on yours, since they will be merged.

So it's probably better not to have that file in Git, since it doesn't support the workflow around which Git is based.

It's actually right to store your design documents in Google Docs or a wiki and your code in Git, rather than everything in Git.

It is easy to have one filestore to rule them all and in the darkness bind them, but if you want to do different things with them, you have to do different things with them. I'm not sure that it's possible to unify text file and binary doc based workflows, but it seems we don't have to worry because users automatically use the best tool for the job and it's only hackers who tie themselves in knots trying to make git do everything.

Re:Is Git Irreplaceable? (2019) by jamil7 on Tuesday January 07, 2020 @04:25AM (#21978359)
I've worked in teams where developers seemed terrified of merge conflicts, to the point of telling eachother not to edit a particular file which seems absurd. Maybe I don't know any better but they seem like part of life.
Re:Is Git Irreplaceable? (2019) by int_19h on Tuesday January 07, 2020 @05:13AM (#21978603)
When at least one person is making changes that touch large parts of the file, it's very sensible to ask others to not touch it, if you don't want to spend hours merging it manually later.