darcs

Issue 2005 the result of ``darcs changes --from-tag X --count`` depends on ``darcs optimize --reorder``...

Title the result of ``darcs changes --from-tag X --count`` depends on ``darcs optimize --reorder``...
Priority feature Status unknown
Milestone Resolved in
Superseder Nosy List galbolle, gh, kowey
Assigned To
Topics UI

Created on 2010-11-30.08:15:31 by gh, last changed 2014-04-09.21:09:45 by bf.

Messages
msg13271 (view) Author: gh Date: 2010-11-30.08:15:30
Here is what I have in my local mirrors of darcs.net and screened
repositories:

darcs.net$ darcs changes --from-tag 2.5 --count
64

darcs.net$ darcs show repo
[...]
 Num Patches: 9129

screened$ darcs changes --from-tag 2.5 --count 
541

screened$ darcs show repo
 [...]
Num Patches: 9223

screened$ darcs push ../darcs.net/ --dry | wc -l
311

With ~3 lines per patch, the above means there are about 100 patches in
screened not in darcs.net, which is consistent with what "darcs show
repo" says.

(BTW this makes me want feature pull --count / push --count:
http://bugs.darcs.net/issue1369)

Anyone can confirm this on their machine?
msg13272 (view) Author: gh Date: 2010-11-30.08:24:50
More info:

screened$ darcs changes --from-tag 2.5  |wc -l
1857

Which corroborates ``darcs changes --from-tag 2.5 --count `` => 541

screened$ darcs changes --from-tag 2.5  -i
Tue Nov 23 19:18:37 CET 2010  Ganesh Sittampalam <ganesh@earth.li>
  * test for behaviour if there is pristine corruption
Shall I view this patch? (1/?) [yN...], or ? for more options: c
Tue Nov 23 19:18:37 CET 2010  Ganesh Sittampalam <ganesh@earth.li>
  * test for behaviour if there is pristine corruption
Shall I view this patch? (1/541) [yN...], or ? for more options:
msg13273 (view) Author: gh Date: 2010-11-30.08:34:40
We're getting close:

darcs.net$ darcs optimize  --reorder
Done optimizing!   
darcs.net$ darcs changes --from-tag 2.5 --count
447
darcs.net$ darcs optimize  --reorder
Done optimizing!   
darcs.net$ darcs changes --from-tag 2.5 --count
447

OK at least the procedure seems idempotent...

In my "screened" repo, ``optimize --reorder`` does not change the count.

So the problem seems to be that the result of ``darcs changes --from-tag
X --count`` depends on ``darcs optimize --reorder``...
msg14469 (view) Author: galbolle Date: 2011-05-26.16:34:02
This is to be expected: "darcs changes --from-tag X" does the same thing
as darcs changes --from-patch "TAG X", which is consistent with the
"TAGs as patches" conception we have.

The problem is that the user does not want to see the same thing with
--from-patch and --from-tag. You would not want --from-patch X to give
you all the patches that X does not depend upon, but that's what you
want --from-tag to do. Also, if we change the meaning of "changes
--from-tag X --count" as you want, either it won't return the right
value for use with --index and friends (which is an invariant we may or
may not want to keep), or it will make changes not read-only (gasp!).

So we can:
- make --from-tag and --from-patch "TAG X" differ
- make tags be a different in all of the UI
- live with 'darcs changes --from-tag X' having the least-intuitive semantic

Note that you can find the number you want from:
darcs unpull --dry --match 'not (name TAG X)' --no-deps | grep '*' | wc -l
(this means that --dry-run should allow --count and other darcs changes
options)
msg17320 (view) Author: bf Date: 2014-04-09.21:09:44
A possible solution would be to add 'darcs changes --tagged-by <tag>'
and 'darcs changes --not-tagged-by <tag>'. These would do what the user
wants to see: a list of all the patches on which the tag does (resp.
does not) not depend.
History
Date User Action Args
2010-11-30 08:15:31ghcreate
2010-11-30 08:24:51ghsetmessages: + msg13272
2010-11-30 08:34:41ghsetmessages: + msg13273
title: bad patch counting --from-tag 2.5 --count in darcs.net and screened -> the result of ``darcs changes --from-tag X --count`` depends on ``darcs optimize --reorder``...
2011-05-26 16:34:03galbollesetpriority: feature
nosy: + kowey, galbolle
topic: + UI
messages: + msg14469
2014-04-09 21:09:45bfsetmessages: + msg17320