Skip to contentSkip to conversation

Locking a branch

DISCUSSION Pavel Roskin 2 participants 2 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

Hello!

I see there is an active discussion about branch attributes. It would be nice to have an attribute to prevent git from changing the branch head in any way. The reason is that it interferes with StGIT on StGIT managed branches. If StGIT is fine with the change, it would remove or override the lock temporarily. StGIT could also unlock the branch permanently if there are no applied patches.

Another use of the branch lock would be to prevent damage to remote branches, such as "origin". Committing anything to "origin" would break fetching. In this case, git-fetch should be allowed to override the lock after checking .git/remotes, but other git commands should respect the lock.

It should be possible to break locks, but the users would at least think before doing so.

Signature · 2 lines
Regards,
Pavel Roskin
#1 lore raw
Quoted 6 lines · Pavel Roskin

I see there is an active discussion about branch attributes. It would be nice to have an attribute to prevent git from changing the branch head in any way. The reason is that it interferes with StGIT on StGIT managed branches. If StGIT is fine with the change, it would remove or override the lock temporarily. StGIT could also unlock the branch permanently if there are no applied patches.

I'm fine with this. At the moment, StGIT does extra checking before some of the commands to ensure that HEAD is the same as the top of the stack (i.e. no commits were generated outside stg commands). While I'll probably still keep this check, the addition would be useful for people mixing GIT and StGIT commands (I personally try to stay with StGIT commands as much as possible).

Signature · 1 line
Catalin