darcs

Patch 1174 New option "--reorder" for the command pull

Title New option "--reorder" for the command pull
Superseder Nosy List alex.aegf
Related Issues
Status accepted Assigned To
Milestone

Created on 2014-06-15.07:41:18 by alex.aegf, last changed 2014-07-21.13:24:40 by gh.

Files
File name Status Uploaded Type Edit Remove
document-pull-__reorder.dpatch gh, 2014-07-21.13:23:59 application/x-darcs-patch
new-option-___reorder_-for-the-command-pull-and-apply_.dpatch alex.aegf, 2014-07-04.02:09:03 application/x-darcs-patch
new-option-___reorder_-for-the-command-pull-and-apply_.dpatch alex.aegf, 2014-07-09.00:50:04 application/x-darcs-patch
new-option-___reorder_-for-the-command-pull.dpatch alex.aegf, 2014-06-15.07:41:18 application/x-darcs-patch
new-option-___reorder_-for-the-command-pull_-apply-and-rebase-pull_.dpatch alex.aegf, 2014-06-18.00:03:03 application/x-darcs-patch
new-option-___reorder_-for-the-command-pull_-apply-and-rebase-pull_.dpatch alex.aegf, 2014-06-18.00:07:31 application/x-darcs-patch
new-option-___reorder_-for-the-command-pull_-apply-and-rebase-pull_.dpatch alex.aegf, 2014-06-18.19:57:59 application/x-darcs-patch
new-option-___reorder_-for-the-command-pull_-apply-and-rebase-pull_.dpatch alex.aegf, 2014-06-18.21:13:41 application/x-darcs-patch
patch-preview.txt alex.aegf, 2014-06-15.07:41:18 text/x-darcs-patch
patch-preview.txt alex.aegf, 2014-06-18.00:03:03 text/x-darcs-patch
patch-preview.txt alex.aegf, 2014-06-18.00:07:31 text/x-darcs-patch
patch-preview.txt alex.aegf, 2014-06-18.19:57:59 text/x-darcs-patch
patch-preview.txt alex.aegf, 2014-06-18.21:13:41 text/x-darcs-patch
patch-preview.txt alex.aegf, 2014-07-04.02:09:03 text/x-darcs-patch
patch-preview.txt alex.aegf, 2014-07-09.00:50:04 text/x-darcs-patch
patch-preview.txt gh, 2014-07-21.13:23:59 text/x-darcs-patch
rebasePullReorderError.sh alex.aegf, 2014-07-03.06:03:55 application/x-sh
unnamed alex.aegf, 2014-06-15.07:41:18
unnamed alex.aegf, 2014-06-18.00:03:03
unnamed alex.aegf, 2014-06-18.00:07:31
unnamed alex.aegf, 2014-06-18.19:57:59
unnamed alex.aegf, 2014-06-18.21:13:41
unnamed alex.aegf, 2014-07-03.06:03:55 text/html
unnamed alex.aegf, 2014-07-03.21:53:28 text/html
unnamed alex.aegf, 2014-07-04.02:09:03
unnamed alex.aegf, 2014-07-09.00:50:04
unnamed gh, 2014-07-21.13:23:59
See mailing list archives for discussion on individual patches.
Messages
msg17545 (view) Author: alex.aegf Date: 2014-06-15.07:41:18
Here goes a patch with the added of the option "--reorder" for the command "pull",
that basically moves to the top the uncommon set of patches between the actual 
repository and the remote repository. I have some simple doubts about the
implementation and it be nice some reviews :)

Doubts (without order of relevance):
1. The name of the variable "uncommon"; other option can be moveToTop.
2. Like fetchPatches is used in the implementation of command "rebase" I define the
   old fetchPatches as fetchPatches', and the new fetchPatches filters the first
   element of the triple. Other option is modify in the implementation of "rebase".
3. I'm not sure if "--reorder" must be a basic or advance option.
4. Comments about the info displayed for reorder doing "darcs pull --help".
5. Maybe the test is too simple.

1 patch for repository http://darcs.net:

Sun Jun 15 04:30:35 ART 2014  Ale Gadea <alex.aegf@gmail.com>
  * New option "--reorder" for the command pull
  The command pull --reorder moves to the top the uncommon
  set of patches between the current repository and remote
  repository which we are pulling.
Attachments
msg17548 (view) Author: gh Date: 2014-06-17.18:57:38
Can the job of moving ours-only patches to the top be delegated to
tentativelyMergePatches directly? That would bring a couple of advantages:

* --reorder would work for pull, apply and rebase pull
* behaviour with regards to conflicting patches would be clearer


Also, I think it's ok if you reuse the existing --reorder (actually
--reorder-patches) flag. And I would make it a basic option.

As for the test I think it's good enough.

As for the "uncommon" name, maybe "oursOnly" would fit.
msg17549 (view) Author: alex.aegf Date: 2014-06-18.00:03:03
1 patch for repository http://darcs.net:

Tue Jun 17 20:13:45 ART 2014  Ale Gadea <alex.aegf@gmail.com>
  * New option "--reorder" for the command pull, apply and rebase pull.
  The option --reorder moves to the top the uncommon
  set of patches between the current repository and remote
  repository.
Attachments
msg17550 (view) Author: alex.aegf Date: 2014-06-18.00:07:31
1 patch for repository http://darcs.net:

Tue Jun 17 20:13:45 ART 2014  Ale Gadea <alex.aegf@gmail.com>
  * New option "--reorder" for the command pull, apply and rebase pull.
  The option --reorder moves to the top the uncommon
  set of patches between the current repository and remote
  repository.
Attachments
msg17551 (view) Author: gh Date: 2014-06-18.18:44:18
I'm having the following compile error with your last bundle:

[143 of 223] Compiling Darcs.Repository.Flags (
src/Darcs/Repository/Flags.hs, dist/build/Darcs/Repository/Flags.o )

src/Darcs/Repository/Flags.hs:5:7:
    Not in scope: type constructor or class `Reorder'
msg17556 (view) Author: alex.aegf Date: 2014-06-18.19:57:59
1 patch for repository http://darcs.net:

Wed Jun 18 16:53:32 ART 2014  Ale Gadea <alex.aegf@gmail.com>
  * New option "--reorder" for the command pull, apply and rebase pull.
  The option --reorder moves to the top the uncommon
  set of patches between the current repository and remote
  repository.
Attachments
msg17559 (view) Author: gh Date: 2014-06-18.20:10:41
For the commands convert, rollback and unrevert, --reorder is not
useful. In fact you can see that the call to tentativelyMergePatches in
these commands is done with NilFl as "usi". So you can directly pass
NoReorder in these cases.
msg17560 (view) Author: alex.aegf Date: 2014-06-18.21:13:41
1 patch for repository http://darcs.net:

Wed Jun 18 18:12:56 ART 2014  Ale Gadea <alex.aegf@gmail.com>
  * New option "--reorder" for the command pull, apply and rebase pull.
  The option --reorder moves to the top the uncommon
  set of patches between the current repository and remote
  repository.
Attachments
msg17568 (view) Author: gh Date: 2014-06-24.19:38:33
Nice. One extra change suggestion: I'd like to be able to bring my own
patches to the top even when I already have all patches (ie when I'm
not to pull anything). Can you change that? I guess it's a matter of
conditioning the exitSuccess to not detecting the flag --reorder.

The same can be done for apply  and pull rebase.
msg17587 (view) Author: alex.aegf Date: 2014-07-03.06:03:55
Hi everyone,

I was finishing the last updates of the patch, and find my self
with the following error introduced in the command "darcs rebase
pull --reorder". I was searching and analyzing trying to understand
the error but I didn't find too much, I suspect that something weird
it's happening with the special patchset "Suspend". Some ideas
or reflexions about it would be great :)

I attach a script that triggers the error, the important thing to look is
printed in red.

Cheers and Thanks!


2014-06-24 16:38 GMT-03:00 Guillaume Hoffmann <bugs@darcs.net>:

>
> Guillaume Hoffmann <guillaumh@gmail.com> added the comment:
>
> Nice. One extra change suggestion: I'd like to be able to bring my own
> patches to the top even when I already have all patches (ie when I'm
> not to pull anything). Can you change that? I guess it's a matter of
> conditioning the exitSuccess to not detecting the flag --reorder.
>
> The same can be done for apply  and pull rebase.
>
> __________________________________
> Darcs bug tracker <bugs@darcs.net>
> <http://bugs.darcs.net/patch1174>
> __________________________________
>



-- 
Ale Gadea
Attachments
msg17588 (view) Author: alex.aegf Date: 2014-07-03.21:53:28
Hi again,

I advanced a little bit and found the following,

as the error report says, it seems that the impossible happend :P
in the function commuteToEnd. But before to comment more about
that I have a questions;

- Can the unique identifier of a path change? (respecting the uniqueness, of
course)

Because after thinking a while and make some tests I realized that
the pattern matching that should be successful in commuteToEnd it
isn't;

| commuteToEnd (p :<: ps) (PatchSet xs ts) | info p `elem` mapRL info xs =
...

because it seems that when checking that a patch *p* is in the patchset *xs*
,
*p* effectively is in *xs* but with a different unique identifier, so as we
are comparing *info*'s;

info p `elem` mapRL info xs == False

This happend when *p* is the:

DO NOT TOUCH: Rebase patch
.
.
.

I'll keep thinking and see if this makes sense. Comments about
it would be great.

Cheers!


2014-07-03 3:03 GMT-03:00 Alejandro Gadea <bugs@darcs.net>:

>
> Alejandro Gadea <alex.aegf@gmail.com> added the comment:
>
> Hi everyone,
>
> I was finishing the last updates of the patch, and find my self
> with the following error introduced in the command "darcs rebase
> pull --reorder". I was searching and analyzing trying to understand
> the error but I didn't find too much, I suspect that something weird
> it's happening with the special patchset "Suspend". Some ideas
> or reflexions about it would be great :)
>
> I attach a script that triggers the error, the important thing to look is
> printed in red.
>
> Cheers and Thanks!
>
>
> 2014-06-24 16:38 GMT-03:00 Guillaume Hoffmann <bugs@darcs.net>:
>
> >
> > Guillaume Hoffmann <guillaumh@gmail.com> added the comment:
> >
> > Nice. One extra change suggestion: I'd like to be able to bring my own
> > patches to the top even when I already have all patches (ie when I'm
> > not to pull anything). Can you change that? I guess it's a matter of
> > conditioning the exitSuccess to not detecting the flag --reorder.
> >
> > The same can be done for apply  and pull rebase.
> >
> > __________________________________
> > Darcs bug tracker <bugs@darcs.net>
> > <http://bugs.darcs.net/patch1174>
> > __________________________________
> >
>
>
>
> --
> Ale Gadea
>
> __________________________________
> Darcs bug tracker <bugs@darcs.net>
> <http://bugs.darcs.net/patch1174>
> __________________________________
>



-- 
Ale Gadea
Attachments
msg17589 (view) Author: alex.aegf Date: 2014-07-04.02:09:03
IMPORTANT: This patches don't solve the problem with rebase
pull. I only break up the original patch in a patch for darcs
pull and apply --reorder, and added a test for the case of
apply, and a patch for the command darcs rebase pull --reorder.

The last advances so far is in the previous mail, and the test
case that trigger the error in the previous previous, with the
name of rebasePullReorderError.

2 patches for repository http://darcs.net:

Thu Jul  3 22:09:32 ART 2014  Ale Gadea <alex.aegf@gmail.com>
  * New option "--reorder" for the command pull and apply.
  The option --reorder moves to the top the uncommon
  set of patches between the current repository and remote
  repository.

Thu Jul  3 23:04:54 ART 2014  Ale Gadea <alex.aegf@gmail.com>
  * New option "--reorder" for the command rebase pull.
  The option --reorder moves to the top the uncommon set
  of patches between the current repository and remote
  repository.
Attachments
msg17593 (view) Author: gh Date: 2014-07-08.09:08:50
I suggest the following to keep things moving:  

* enable --reorder to work even when no new patches are pulled/applied
(see my previous comment)
* open a bug for "rebase pull --reorder"
* include the failing test in a third patch following the guidelines of
http://darcs.net/Development/RegressionTests (in particular the script
should be named failing-issuexxxx_rebase_pull_reorder.sh)
msg17595 (view) Author: alex.aegf Date: 2014-07-09.00:50:04
3 patches for repository http://darcs.net:

Tue Jul  8 21:33:42 ART 2014  Ale Gadea <alex.aegf@gmail.com>
  * New option "--reorder" for the command pull and apply.
  The option --reorder moves to the top the uncommon
  set of patches between the current repository and remote
  repository.

Tue Jul  8 21:33:50 ART 2014  Ale Gadea <alex.aegf@gmail.com>
  * New option "--reorder" for the command rebase pull.
  The option --reorder moves to the top the uncommon set
  of patches between the current repository and remote
  repository.

Tue Jul  8 21:36:20 ART 2014  Ale Gadea <alex.aegf@gmail.com>
  * Add failing test for issue2403: darcs rebase pull --reorder crashes in src/Darcs/Patch/Depends.hs:275
Attachments
msg17618 (view) Author: gh Date: 2014-07-21.13:23:59
ok, I'm accepting the bundle with the following documentation patch.

1 patch for repository http://darcs.net:

Mon Jul 21 10:19:56 ART 2014  Guillaume Hoffmann <guillaumh@gmail.com>
  * document pull --reorder
Attachments
History
Date User Action Args
2014-06-15 07:41:18alex.aegfcreate
2014-06-17 18:57:39ghsetmessages: + msg17548
2014-06-18 00:03:04alex.aegfsetfiles: + patch-preview.txt, new-option-___reorder_-for-the-command-pull_-apply-and-rebase-pull_.dpatch, unnamed
messages: + msg17549
2014-06-18 00:07:31alex.aegfsetfiles: + patch-preview.txt, new-option-___reorder_-for-the-command-pull_-apply-and-rebase-pull_.dpatch, unnamed
messages: + msg17550
2014-06-18 18:44:19ghsetmessages: + msg17551
2014-06-18 19:57:59alex.aegfsetfiles: + patch-preview.txt, new-option-___reorder_-for-the-command-pull_-apply-and-rebase-pull_.dpatch, unnamed
messages: + msg17556
2014-06-18 20:10:41ghsetmessages: + msg17559
2014-06-18 21:13:41alex.aegfsetfiles: + patch-preview.txt, new-option-___reorder_-for-the-command-pull_-apply-and-rebase-pull_.dpatch, unnamed
messages: + msg17560
2014-06-24 19:38:33ghsetmessages: + msg17568
2014-07-03 06:03:55alex.aegfsetfiles: + unnamed, rebasePullReorderError.sh
messages: + msg17587
2014-07-03 21:53:29alex.aegfsetfiles: + unnamed
messages: + msg17588
2014-07-04 02:09:03alex.aegfsetfiles: + patch-preview.txt, new-option-___reorder_-for-the-command-pull-and-apply_.dpatch, unnamed
messages: + msg17589
2014-07-08 09:08:50ghsetmessages: + msg17593
2014-07-09 00:50:04alex.aegfsetfiles: + patch-preview.txt, new-option-___reorder_-for-the-command-pull-and-apply_.dpatch, unnamed
messages: + msg17595
2014-07-21 13:24:00ghsetfiles: + patch-preview.txt, document-pull-__reorder.dpatch, unnamed
messages: + msg17618
2014-07-21 13:24:40ghsetstatus: needs-screening -> accepted