locking: add post-merge hook to unlock locks#1817
locking: add post-merge hook to unlock locks#1817ttaylorr wants to merge 8 commits intolocking-pre-pushfrom
Conversation
sinbad
left a comment
There was a problem hiding this comment.
I don't understand why you would want to do this.
If I merged a branch locally into master, that says nothing about whether that file should now be unlocked. Locking is meant to prevent accidental parallel changes which would require one side of a binary file change to be discarded; merging changes into master locally doesn't change the fact that I have changes locally which no-one else can see yet, so shouldn't start making changes in parallel with me.
If you wanted to automatically unlock files on completion of work, this post-merge hook should run on the server, not in git-lfs clients.
|
I agree that we should hold off on automatic things like this until we're sure it's something users really want. I don't agree that only servers should handle auto-unlocking. We could add the ability to install and uninstall optional hooks like EDIT: I meant "auto-unlocking", not "auto-locking" :) |
I'm not suggesting that, only that unlocking on local merge will fundamentally break the premise that locking deters parallel edits, because it will make other users believe that it's ok to lock the file now when in fact it isn't (doing so would create a parallel edit because changes are only local to the user who just auto-unlocked) |
|
Oh I see what you're saying. We slipped this in for a low-effort demo of auto-unlocking, instead of implementing it on the server. I agree this is the wrong way to implement on the client, if that's what we want. Probably a better way is to look for locked files when pushing to |
|
Yep, |
|
I'm in agreement, and I think we can close this for now 👍 |
This pull-request implements a post-merge hook to unlock all locked (owned) files merged back into the
masterbranch of a repository.Here's a breakdown of what happened:
post-mergehookpost-mergehookgit-lfs updatecommand to use generic messageSome things I'd like to consider before merging:
master?What should happen if the merge is done using the--no-verifyoption, skipping thepre-commithook and merging a file locked by someone other than the current committer?/cc @git-lfs/core