← Back to context

Comment by flohofwoe

19 hours ago

> Git is intended to be fully distributed

Which is kinda funny because most people use git through Github or Gitlab, e.g. forcing git back into a centralized model ;)

> People should use the VCS that's appropriate for their project rather than insist on git everywhere.

Indeed, but I think that train has left long ago :)

I had to look it up after I wrote that paragraph about locking, but it looks like file locking is supported in Git (just weird that I need to press a button in the Gitlab UI to lock a file:

https://docs.gitlab.com/user/project/file_lock/

...and here it says it's only supported with git lfs (so still weird af):

https://docs.gitlab.com/topics/git/file_management/#file-loc...

...why not simply 'git lock [file]' and 'git push --locks' like it works with tags?

If you’re making local commits (or local branch, or local merge, etc), you’re leveraging the distributed nature of Git. With SVN all these actions required being done on the server. This meant if you were offline and were thinking of making a risky change you might want to back out of, there was no way on SVN to make an offline commit which you could revert to if you wanted.

Of course if you’re working with others you will want a central Git server you all synchronize local changes with. GitHub is just one of many server options.

  • Shortly after git became popular, the Subversion team released a tool that enabled replicating a SVN repository or any subset to a local independent repository, which could be used for local development and re-synced to the main repository at any time.

  • I'm pretty sure that if required, SVN could be updated to have an 'offline mode' where more offline operations would be allowed, since it keeps a local shadow copy of the last repository state from the server anyway. But offline mode simply isn't all that necessary anymore. How often is an average programmer in an area without any mobile coverage or other means of internet connectivity?

I very much dislike git (mostly because software hasn't been "just source" for many decades before git was hobbled together, and git's binary handling is a huge pain for me), but what does a lockfile achieve that a branch -> merge doesn't, practically, and even conceptually?

  • Binary files can't be meaningfully merged. E.g. if two people create separate branches and work on the same Photoshop file, good luck trying to merge those changes, you can at best pick one version and the other user just wasted a lot of time. A lock communicates to other users "hey I'm currently working on that file, don't touch it" - this also means that lockable files must be write-only all the time unless explicitly locked - so that people don't "accidentially" start working on the file without acquiring a lock first. Apparently (as far as I have gathered so far from googling) git-lfs supports file locking but not vanilla git.

    • > Binary files can't be meaningfully merged.

      I think we really need more development of format-specific diff and merge tools. A lot of binary formats could absolutely be diffed or merged, but you'd need algorithms and maybe UIs specific to that format - there is no "generic" algorithm like for text-based files. (And even there, generic line-wise diffing if often more "good enough" than really good)

      I think it would be awesome if we could get "diff/merge servers" analogous to the "language servers" for IDEs some day.

      5 replies →