[darcs-users] Unpushable patches

Tommy Pettersson ptp at lysator.liu.se
Sat Oct 7 12:26:47 UTC 2006


On Thu, Oct 05, 2006 at 10:36:51PM +1000, Hoan Ton-That wrote:
> I was thinking of having another option 'i' when recording
> which makes the patch ignored.  Also record will take a
> --ignore option which makes the patch ignored.  Finally
> amend-record would prompt asking if the patch would like
> to be made ignored or unignored.
> 
> Any comments or suggestions are appreciated.

The easy way to implement ignored patches is with an ignore list
in _darcs/prefs/. I think this would absolutely be the best to
start with. It has some theoretical limitations, but it would
require much more complicated changes to get around them, and we
don't know if there really is any need for those yet. But it can
be good to know about them, and to express them in the
documentation.

The first is that older versions of darcs will... eh, ignore to
ignore ignored patches. Ignored patches could be hidden in a
special _darcs/ignoredpatches/ dir where older darcses can't
find them, but there wouldn't be any point in that, since the
purpose of ignored patches can never be to hide secret changes
anyway; accessible darcs repos are accessible also to any hacked
version of darcs.

The second limitation is that normal patches can depend on
ignored patches. A nice feature would be if Record informed
about this when recording a new patch, but unfortunately the
required calculation takes too long and doesn't scale with the
number of patches in the repo. Besides, any patch could be made
ignored at any time, so any normal patch could suddenly get an
ignored patch in its dependencies, and this has to be dealt
with. The manifestation of the problem is when the user wants to
do something with a normal patch that is impossible because of
the dependency on the ignored patch. Darcs should in some way
inform the user about the (or simply an) ignored patch. Ignored
patches could instead be "floated", but then the ignored patches
must be truly local, since floating a patch would really create
a new one in place of the old one, and that would be in conflict
with another possible extension to ignored patches: separate
ignore lists for pull and push, i.e. "I don't want to have this
patch" versus "I don't want to expose this patch".

This leads to another decision to make. A pull / push / send /
apply concerns two repos, each with an individual ignore list. I
think the right approach for starter is to use the union of
these lists. Hm, there is also the context file (produced with
'darcs changes --context'), but it doesn't feel right to include
the ignored list there, does it?

There should be a global option for all commands to overriding
the ignore lists, even for Amend-record.

David's idea in RT#37 to have users delete entries from
_darcs/prefs/ignored is a lot easier to implement (to start
with). I don't think Amend-record should be used to toggle the
ignored state. We stress very strongly in the documentation that
Amend-record REPLACES the old patch with a new one. This will
still be true when Amend-record some day can change the patch
name and long comment. But it wouldn't be true for just toggling
the ignore state, and it would suddenly become much much more
complicated to explain when it's safe to use Amend-record, and
why, and why and when not, and so on.

One could also argue if the Record dialogue should ask "Is this
a local patch? [yn]", as it does with "Do you want to add a long
comment? [yn]", instead of having the --ignored option. I think
maybe not, but I raise the question.


-- 
Tommy Pettersson <ptp at lysator.liu.se>




More information about the darcs-users mailing list