gnu-arch-users
[Top][All Lists]
Advanced

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

Re: [Gnu-arch-users] request for comments on partial commits


From: Andrew Suffield
Subject: Re: [Gnu-arch-users] request for comments on partial commits
Date: Fri, 24 Feb 2006 00:40:25 +0000
User-agent: Mutt/1.5.11+cvs20060126

On Wed, Feb 22, 2006 at 07:50:08PM +0100, Lionel Elie Mamane wrote:
> On Tue, Feb 21, 2006 at 10:57:31PM -0800, Andy Tai wrote:
> 
> > Hi, for the partial commit problem I am thinking of a simple method:
> > the user will have to commit the whole tree after a file renaming or
> > file deletion operation, which means the change to the directory
> > content.  Are there any objection to this approach as a short-term
> > measure?

Isn't that what currently happens? I forget.

> 
> Short term, it is OK, but long term you want:
> 
>  - For every smallest set S of file names such that S is stable by the
>    operation "f got moved to f'", the user has to commit either all
>    files whose old or new name is in S.
> 
> Implementing the graph walking algorithms to find the partition of
> files in S's in C is left as an exercise to the reader.

Since the only use case is that where you've been given a list of
files that you want to commit, this can be implemented by an
edge-pushing algorithm:

For every filename in the current set:

  Get the filename of this object in the previous revision. This is
  the prior filename.

  If the prior filename is equal to the current filename, skip this file.

  If the prior filename is present in the project tree, (fail | add
  that file).

  If the current filename is present in the previous revision, (fail |
  add that file).

I probably missed something here because I did that off the top of my
head, but I believe this is tractable and fairly easy.

Of course, you still have to scan the entire current and prior
revision in order to build an inventory.

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]