darcs

Issue 2657 darcs show dependencies doesn't stop at the last clean tag

Title darcs show dependencies doesn't stop at the last clean tag
Priority Status wont-fix
Milestone Resolved in
Superseder Nosy List ganesh
Assigned To
Topics

Created on 2020-10-15.20:16:07 by ganesh, last changed 2020-10-22.16:42:52 by bfrk.

Files
File name Uploaded Type Edit Remove
accept-issue2657-_-darcs-show-dependencies-and-tags_0.dpatch ganesh, 2020-10-16.16:33:34 application/octet-stream
Messages
msg22455 (view) Author: ganesh Date: 2020-10-15.20:16:04
In darcs 2.16.2, "darcs show dependencies" doesn't stop at the last clean 
tag, whereas in darcs 2.14.x it did. The documentation says:

> The `darcs show dependencies` command is used to create a graph of the
> dependencies between patches of the repository (by default up to last 
> tag).

I'll make a test case to demonstrate it.
msg22456 (view) Author: bfrk Date: 2020-10-16.14:35:42
> In darcs 2.16.2, "darcs show dependencies" doesn't stop at the last clean 
> tag, whereas in darcs 2.14.x it did. The documentation says:
> 
>> The `darcs show dependencies` command is used to create a graph of the
>> dependencies between patches of the repository (by default up to last 
>> tag).

I think this behavior fell victim to simplification when I re-wrote the
command. You can get the old behavior back using something like `darcs
show dependencies --from-tag .` The old default behavior is not very
useful IMO: if there are many patches after the last tag then your graph
gets too large to be useful; conversely, if there are too few patches
then it doesn't tell you much. I'd vote for just adapting the docs.

There are other commands which limit their effect to patches after the
latest clean tag (inclusive or exclusive), like obliterate. IMO these
limitations are all bad and I would like to remove them.
msg22457 (view) Author: ganesh Date: 2020-10-16.16:33:34
FYI I tracked it down with test --backoff to:

> patch 12bead4cc6802d4dd2f25c8672f36c7f750e10dd
> Author: Ben Franksen <ben.franksen@online.de>
> Date:   Wed Jan 29 12:43:01 GMT Standard Time 2020
>   * review matching options for show dependencies

>   Showing the dependency graph makes the most sense for a range of patches. We
>   rename the combined matching option matchRange to matchOneOrRange (used for
>   diff) and add a different matchRange function that excludes the single patch
>   variants. Since the log command already has a function matchRange, we factor
>   that into D.UI.Command.Util and re-use it.

Test case attached. Given your comments I'm not sure if we
want to commit said test.
Attachments
msg22477 (view) Author: bfrk Date: 2020-10-17.10:07:14
> Test case attached. Given your comments I'm not sure if we
> want to commit said test.

I think what we should do is to adapt the docs and also add a warning to
explain that without restricting the range of patches this can take a
/very/ long time to compute.

Alternatively, or additionally, we could add progress information.
Unfortunately my attempts at doing that failed:

-        putDocLn $ renderDepsGraphAsDot $ depsGraph $ reverseFL rFl
+        putDocLn $ renderDepsGraphAsDot $ depsGraph $ progressRL
"determine dependencies" $ reverseFL rFl

This doesn't print any progress info. Any idea why?
msg22478 (view) Author: ganesh Date: 2020-10-17.13:49:16
I share the view that the current behaviour is not perfect: it's quite 
operational in that it depends on patch order and tag cleanliness.

I don't think defaulting to all patches is a good default either though.
Neither do I have a good third suggestion :-)

FYI original report from a user on IRC here:
https://freenode.logbot.info/darcs/20201013

and followup discussion here:
https://freenode.logbot.info/darcs/20201016

The user also reports that transitive dependencies are being shown in
addition to direct dependencies, a regression from 2.14. I haven't
dug into that or written a test case yet.
msg22480 (view) Author: bfrk Date: 2020-10-17.14:44:09
I am sorry I messed up the 'show dependencies' command so thoroughly. 
I have opened a new issue2658 for the indirect dependencies problem.
msg22499 (view) Author: bfrk Date: 2020-10-22.16:42:48
After some discussion on #darcs I decided not to re-introduce this 
feature. You can use "darcs show dependencies --from-tag ." to achieve 
nearly the same behavior as before. The documentation has been adapted 
instead. Additionally, the command now reports progress while 
calculating the dependencies, allowing users to judge whether they want 
to wait or else abort the command and restart with a smaller range of 
patches.

patch 8f2405f53194c0b7e8352bd56c462000b32de683
Author: Ben Franksen <ben.franksen@online.de>
Date:   Mon Oct 19 13:50:05 CEST 2020
  * add progress reporting to show dependencies command
Shall I view this patch? (1/?) [yN...], or ? for more options: n

patch 2a577715e60faafe1f7194a9a8d9b9643760f0d6
Author: Ben Franksen <ben.franksen@online.de>
Date:   Mon Oct 19 10:47:06 CEST 2020
  * fix and improve help text for show dependencies
History
Date User Action Args
2020-10-15 20:16:07ganeshcreate
2020-10-16 14:35:46bfrksetmessages: + msg22456
2020-10-16 16:33:38ganeshsetfiles: + accept-issue2657-_-darcs-show-dependencies-and-tags_0.dpatch
messages: + msg22457
2020-10-17 10:07:17bfrksetmessages: + msg22477
2020-10-17 13:49:20ganeshsetstatus: needs-testcase -> needs-diagnosis/design
messages: + msg22478
2020-10-17 14:44:12bfrksetmessages: + msg22480
2020-10-22 16:42:52bfrksetstatus: needs-diagnosis/design -> wont-fix
messages: + msg22499