# Locking a branch

2 messages from 2006-05-07 to 2006-05-08. Participants: Pavel Roskin, Catalin Marinas.
Thread: https://gitlist.dev/t/4087

## Pavel Roskin, 2006-05-07 02:50

Subject: Locking a branch
Message-ID: <1146970243.24434.77.camel@dv>
URL: https://gitlist.dev/e/1146970243.24434.77.camel%40dv

```
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.

-- 
Regards,
Pavel Roskin

```

## Catalin Marinas, 2006-05-08 10:45

Subject: Re: Locking a branch
Message-ID: <tnxzmhspzg2.fsf@arm.com>
URL: https://gitlist.dev/e/tnxzmhspzg2.fsf%40arm.com
In-Reply-To: <1146970243.24434.77.camel@dv>

```
Pavel Roskin <proski@gnu.org> wrote:
> 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).

-- 
Catalin

```
