[darcs-devel] [issue1287] darcs diff --last: inconsistent behaviour

Gian Piero Carrubba bugs at darcs.net
Sun Dec 28 11:16:51 UTC 2008


New submission from Gian Piero Carrubba <gp-ml at rm-rf.it>:

* Actions to reproduce:

(sid)gp-ml at king:~/tmp/test/darcsdiff$ ls
(sid)gp-ml at king:~/tmp/test/darcsdiff$ mkdir newrepo
(sid)gp-ml at king:~/tmp/test/darcsdiff$ cd newrepo/
(sid)gp-ml at king:~/tmp/test/darcsdiff/newrepo$ darcs init
(sid)gp-ml at king:~/tmp/test/darcsdiff/newrepo$ touch foo
(sid)gp-ml at king:~/tmp/test/darcsdiff/newrepo$ darcs rec -la -m 'initial record'
Finished recording patch 'initial record'
(sid)gp-ml at king:~/tmp/test/darcsdiff/newrepo$ echo 1 > foo
(sid)gp-ml at king:~/tmp/test/darcsdiff/newrepo$ darcs rec -la -m 'second record'
Finished recording patch 'second record'
(sid)gp-ml at king:~/tmp/test/darcsdiff/newrepo$ echo 2 > foo
(sid)gp-ml at king:~/tmp/test/darcsdiff/newrepo$ darcs changes
Sun Dec 28 11:07:20 CET 2008  "Gian Piero Carrubba" <gp-ml at rm-rf.it>
  * second record

Sun Dec 28 11:06:52 CET 2008  "Gian Piero Carrubba" <gp-ml at rm-rf.it>
  * initial record
(sid)gp-ml at king:~/tmp/test/darcsdiff/newrepo$ darcs diff -u --last 1
Sun Dec 28 11:07:20 CET 2008  "Gian Piero Carrubba" <gp-ml at rm-rf.it>
  * second record
diff -rN -u old-newrepo/foo new-newrepo/foo
--- old-newrepo/foo     2008-12-28 11:07:39.000000000 +0100
+++ new-newrepo/foo     2008-12-28 11:07:39.000000000 +0100
@@ -0,0 +1 @@
+2

(sid)gp-ml at king:~/tmp/test/darcsdiff/newrepo$

* Expected behaviour:

(sid)gp-ml at king:~/tmp/test/darcsdiff/newrepo$ darcs diff -u --last 1
Sun Dec 28 11:07:20 CET 2008  "Gian Piero Carrubba" <gp-ml at rm-rf.it>
  * second record
diff -rN -u old-newrepo/foo new-newrepo/foo
--- old-newrepo/foo     2008-12-28 11:07:39.000000000 +0100
+++ new-newrepo/foo     2008-12-28 11:07:39.000000000 +0100
@@ -0,0 +1 @@
+1

(sid)gp-ml at king:~/tmp/test/darcsdiff/newrepo$

* Version:

v2.1.0 from Debian sid repository.

(sid)gp-ml at king:~/tmp/test/darcsdiff/newrepo$ darcs -v
2.1.0 (release)
(sid)gp-ml at king:~/tmp/test/darcsdiff/newrepo$ dpkg -l darcs
[..]
ii  darcs          2.1.0-1        a distributed, interactive, smart

I can't build the latest version from the darcs.net repository, but the
changelog doesn't tell anything meaningful (to me) about this matter so
I assume the behaviour hasn't been changed in the mean time.

* Rationale:

As you can see, `darcs diff --last N` outputs the content of the last N
patches *plus* the not-yet-recorded changes. It seems to me that's an
unexpected behaviour and inconsistent with the log prepended to the diff
output, where there is no reference to further changes made to the
workdir and not yet recorded. IMHO, `darcs diff --last N` should only
output the content of the last N patches.

Thanks,
Gian Piero.

----------
messages: 6913
nosy: dmitry.kurochkin, gp-ml, kowey, simon, thorkilnaur
status: unread
title: darcs diff --last: inconsistent behaviour

__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/issue1287>
__________________________________


More information about the darcs-devel mailing list