Re: [JGIT PATCH 2/2] Make Repository.isValidRefName compatible with Git 1.6.3

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Fri, 8 May 2009, Alex Riesen wrote:

> 2009/5/8 Shawn O. Pearce <spearce@xxxxxxxxxxx>:
> > --- a/lockfile.c
> > +++ b/lockfile.c
> > @@ -129,11 +129,11 @@ static int lock_file(struct lock_file *lk, const char *path, int flags)
> >        strcpy(lk->filename, path);
> >        /*
> >         * subtract 5 from size to make sure there's room for adding
> > -        * ".lock" for the lock file name
> > +        * "..lck" for the lock file name
> >         */
> >        if (!(flags & LOCK_NODEREF))
> >                resolve_symlink(lk->filename, sizeof(lk->filename)-5);
> > -       strcat(lk->filename, ".lock");
> > +       strcat(lk->filename, "..lck");
> >        lk->fd = open(lk->filename, O_RDWR | O_CREAT | O_EXCL, 0666);
> 
> There must be at least some deprecation period during which
> also the old .lock lockfiles are considered and created.
> Just imagine someone modifying the ref with an older version,
> which knows nothing about ..lck.

As lock files are only supposed to be created by Git itself, and have a 
maximum lifetime until the end of the process, I think we do not need a 
grace period at all.

Ciao,
Dscho

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]