darcs

Issue 1632 darcs changes dir/file-that-never-existed should not list any patches

Title darcs changes dir/file-that-never-existed should not list any patches
Priority bug Status resolved
Milestone Resolved in
Superseder Nosy List bfr, darcs-devel, dmitry.kurochkin, drewp, jaredj, kowey
Assigned To
Topics FilePath

Created on 2009-09-30.16:05:44 by bfr, last changed 2015-06-17.21:56:39 by bf.

Messages
msg8888 (view) Author: bfr Date: 2009-09-30.16:05:42
This is a (minor UI) bug in 2.3.1. How to repeat:

> darcs init; mkdir dir; darcs record -lam'added dir'
Finished recording patch 'added dir'
> darcs changes -s dir/non-existent-file
Changes to dir/non-existent-file:

Wed Sep 30 17:59:08 CEST 2009  benjamin.franksen@bessy.de
  * added dir

    A ./dir/

The output should be empty (IMO).
msg8889 (view) Author: kowey Date: 2009-09-30.20:36:35
I haven't tried to reproduce this, but this sounds like a simple consequence of
the filepath being filtered out and darcs changes thinking it's doesn't have any
arguments.

Other commands have special code to detect just this case.  It'd be good to poke
around a bit.

Benjamin: is there any chance you'd be willing to submit a regression for this?
http://wiki.darcs.net/RegressionTests

Marking need-action because this is something just about anybody could do if
Benjamin can't
msg8895 (view) Author: bfr Date: 2009-10-01.09:59:31
I submitted a regression test.
msg8901 (view) Author: kowey Date: 2009-10-02.12:39:40
Thanks for the test.  We just need somebody to roll up their sleeves, insert a
few putStrLns and hack.

Whee! Having a plentiful supply of ProbablyEasy bugs is nice when we have an
upcoming hacking sprint (especially one where we're trying to train new Darcs
hackers)
msg8918 (view) Author: bfr Date: 2009-10-07.11:25:16
On Mittwoch, 30. September 2009, Eric Kow wrote:
> Eric Kow <kowey@darcs.net> added the comment:
> I haven't tried to reproduce this, but this sounds like a simple
> consequence of the filepath being filtered out and darcs changes thinking
> it's doesn't have any arguments.

Unfortunately it is not. I managed to track it down to 
Darcs.Patch.TouchesFiles.look_touch which actually gives back the wrong 
result with the test.

look_touch :: Patchy p => [FilePath] -> p C(x y) -> (Bool, [FilePath])

When I instrument this function to print out its result and run darcs 
changes d/notthere on a repo tat just contains d, (as in the test case) I 
get:

ben@sarun[1]: .../darcs/darcs.net > ./dist/build/darcs/darcs changes 
d/notthere --repodir=tests/R
Changes to d/notthere:

look_touch: (True,["./d/notthere"])
Sat Oct  3 14:31:38 CEST 2009  ben.franksen@online.de
  * added directory d

I understand that look_touch is used in many places in darcs and even if I 
managed to understand how it works (which I don't, see below) and 'fix' it, 
this would probably break other darcs commands.

Darcs.Patch.TouchesFiles.look_touch lacks any documentation. Looking at its 
code, I see that it gets the list of files by applying another undocumented 
function Darcs.Patch.Apply.apply_to_filepaths which, int turn, calls the 
undocumented method apply from class Apply. It looks as if apply doesn't 
necessarily apply a patch, depending on which instance is selected, but 
what it is /supposed/ to do if not apply the patch is beyond me to guess.

This is the point at which I gave up.

Cheers
Ben
msg8919 (view) Author: kowey Date: 2009-10-07.12:01:12
Thanks for looking into this!  It looks like we'd need a more experienced Darcs
hacker to document look_touch.
msg18548 (view) Author: bf Date: 2015-06-17.21:56:37
Seems this has been fixed since, as the test now suceeds (darcs1 and
darcs2).
History
Date User Action Args
2009-09-30 16:05:45bfrcreate
2009-09-30 20:36:41koweysetpriority: bug
status: unknown -> needs-reproduction
topic: + FilePath
messages: + msg8889
nosy: + kowey
2009-09-30 20:37:10koweysettopic: + ProbablyEasy
nosy: + jaredj
2009-10-01 09:59:37bfrsetnosy: kowey, darcs-devel, jaredj, dmitry.kurochkin, bfr
messages: + msg8895
2009-10-02 12:39:50koweysetstatus: needs-reproduction -> needs-implementation
nosy: kowey, darcs-devel, jaredj, dmitry.kurochkin, bfr
messages: + msg8901
2009-10-07 11:25:20bfrsetnosy: kowey, darcs-devel, jaredj, dmitry.kurochkin, bfr
messages: + msg8918
2009-10-07 12:01:16koweysetstatus: needs-implementation -> needs-reproduction
nosy: kowey, darcs-devel, jaredj, dmitry.kurochkin, bfr
topic: - ProbablyEasy
messages: + msg8919
2009-10-23 22:35:28adminsetnosy: + benjamin.franksen, - bfr
2009-10-23 23:46:20adminsetnosy: + bfr, - benjamin.franksen
2010-02-11 04:42:18drewpsetnosy: + drewp
2015-06-17 21:56:39bfsetstatus: needs-reproduction -> resolved
messages: + msg18548