darcs

Issue 1287 darcs diff --last: inconsistent behaviour

Title darcs diff --last: inconsistent behaviour
Priority not-our-bug Status resolved
Milestone Resolved in
Superseder Nosy List darcs-devel, dmitry.kurochkin, gp-ml, kowey, thorkilnaur
Assigned To
Topics

Created on 2008-12-28.11:16:51 by gp-ml, last changed 2009-10-23.23:53:53 by admin.

Messages
msg6913 (view) Author: gp-ml Date: 2008-12-28.11:16:48
* Actions to reproduce:

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

Sun Dec 28 11:06:52 CET 2008  "Gian Piero Carrubba" <gp-ml@rm-rf.it>
  * initial record
(sid)gp-ml@king:~/tmp/test/darcsdiff/newrepo$ darcs diff -u --last 1
Sun Dec 28 11:07:20 CET 2008  "Gian Piero Carrubba" <gp-ml@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@king:~/tmp/test/darcsdiff/newrepo$

* Expected behaviour:

(sid)gp-ml@king:~/tmp/test/darcsdiff/newrepo$ darcs diff -u --last 1
Sun Dec 28 11:07:20 CET 2008  "Gian Piero Carrubba" <gp-ml@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@king:~/tmp/test/darcsdiff/newrepo$

* Version:

v2.1.0 from Debian sid repository.

(sid)gp-ml@king:~/tmp/test/darcsdiff/newrepo$ darcs -v
2.1.0 (release)
(sid)gp-ml@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.
msg6955 (view) Author: gp-ml Date: 2009-01-02.19:29:19
On Sun, Dec 28, 2008 at 10:08:47PM +0100, Gian Piero Carrubba wrote:
> Sorry for the noise, the behaviour is intentional and clearly
> documented in the help:
> 
> > Specifying just --from-patch will get you a diff against
> > your working copy.  If you give diff no version arguments, it gives
> > you the same information as whatsnew except that the patch is
> > formatted as the output of a diff command
> 
> Please, feel free to close this issue (if my pathetic try to do this via
> mail doesn't succeed :) ).
> 
> 
> Thanks,
> Gian Piero.
History
Date User Action Args
2008-12-28 11:16:51gp-mlcreate
2009-01-02 19:29:24gp-mlsetstatus: unread -> resolved
nosy: kowey, simon, thorkilnaur, dmitry.kurochkin, gp-ml
messages: + msg6955
2009-04-22 02:38:13twbsetpriority: not-our-bug
nosy: kowey, simon, thorkilnaur, dmitry.kurochkin, gp-ml
2009-08-25 17:37:11adminsetnosy: + darcs-devel, - simon
2009-08-27 14:17:18adminsetnosy: kowey, darcs-devel, thorkilnaur, dmitry.kurochkin, gp-ml
2009-10-23 22:35:43adminsetnosy: + gpiero, - gp-ml
2009-10-23 23:53:53adminsetnosy: + gp-ml, - gpiero