[darcs-devel] darcs patch: whatsnew --look-for-adds doesn't read unadded files (f...

Jason Dagit dagit at codersbase.com
Fri Sep 8 17:01:22 PDT 2006


On 9/8/06, Tommy Pettersson <ptp at lysator.liu.se> wrote:
> On Fri, Sep 08, 2006 at 10:26:07AM -0700, Jason Dagit wrote:
> > Fri Sep  8 10:09:47 PDT 2006  Jason Dagit <dagit at codersbase.com>
> >   * whatsnew --look-for-adds doesn't read unadded files (fix for issue79)
> >   Changes darcs whatsnew --look-for-adds to by default stop computing the patch
> >   for a while when it realizes the file is not managed by darcs.  This matches
> >   the default of summary mode.  Changes were required in the commands:
> >     amend-record, apply, diff, pull, record, resolve.
> >   A change was needed for each because they use get_unrecorded which was modified
> >   so that it would pass on the necessary information to smart_diff so that it
> >   would know when to skip reading file contents.
>
> I've reviewed this patch and tested it slightly, and I think it
> looks good.
>
> But I don't understand the NoSummary business. I found an old
> message on the list about some short-circuit strategy -- that
> this is to prevent other changes from accidently turning this
> pruning off, but I'm not sure how it works. I tried to simply
> revert all the NoSummary-s from amend-record, apply, et al., and
> everything continued to work.

It may very well be redundant in some cases.  I took a conservative
approach (fearing corner cases).  If you're not in summary mode and
smart_diff behaves as if you are then your patches will be incorrectly
created.  It's been a long time since the wrote the code, but I could
have sworn I was able to trigger a bug in some other command when I
didn't take this conservative approach.  I think that other command
was record?  I seem to recall it being something like you'd get empty
hunks in your patch.  If someone can think of a way to simplify the
changes that would be great.

Jason




More information about the darcs-devel mailing list