Bug#733504: quilt: please sort order of files in diffs ASCIIbetically

2013-12-30 Thread Raphael Hertzog
On Sun, 29 Dec 2013, Martin Quinson wrote:
 I checked a bit more, and the documentation is a bit misleading here
 as the order of a find is used when --sort is not provided. So this is
 not the patch order at all.

So this is the thing to fix as the order of find might differ when
you generate the patch on one system and refresh it on another and thus
you might introduce useless noise in a VCS.

Cheers,
-- 
Raphaël Hertzog ◈ Debian Developer

Discover the Debian Administrator's Handbook:
→ http://debian-handbook.info/get/


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#733504: quilt: please sort order of files in diffs ASCIIbetically

2013-12-30 Thread Martin Quinson
On Mon, Dec 30, 2013 at 08:57:46AM +0100, Raphael Hertzog wrote:
 On Sun, 29 Dec 2013, Martin Quinson wrote:
  I checked a bit more, and the documentation is a bit misleading here
  as the order of a find is used when --sort is not provided. So this is
  not the patch order at all.
 
 So this is the thing to fix as the order of find might differ when
 you generate the patch on one system and refresh it on another and thus
 you might introduce useless noise in a VCS.

*
* TL;DR *
*
I think that this bug cannot happen with our codebase. 
I need a test case that I can play with.
In lack of this, I blame dpkg for the behavior you saw, not quilt.

* long version *


I digged a bit further, and I think I misunderstood the code the first
time: the documentation seem right. Here is how the list of files is
generated in quilt/refresh:

-8-8-
if [ -z $opt_sort ]
then
files=( $(files_in_patch_ordered $patch) )
else
files=( $(files_in_patch $patch | sort) )
fi
-8-8

If you pass the --sort argument, then the result of the find (as
computed by the function files_in_patch) is sorted. If not
($opt_sort is empty), then the function files_in_patch_ordered()
does the following:

-8-8-
(   files_in_patch $patch | sort
echo -
filenames_in_patch $patch
) | awk '
$1 == - { out=1 ; next }
!out{ files[$0]=1
  new_files[++n]=$0 }
out { if ($0 in files  !($0 in printed)) {
print $0
printed[$0]=1
  }
}
END {
  for (i=1; i=n; i++)
if (!(new_files[i] in printed))
  print new_files[i]
}
'
-8-8

filenames_in_patch() gets all the filenames that are present in the
patch file.

At the end of the day, the previous chunk gets all modified files (as
found by find in files_in_patch), and then prints them in the patch
order (as found by filenames_in_patch) if they are present, and in the
sort order if they are new.

Q.E.D.: This bug cannot happen with quilt.


Are you sure that your patch got regenerated by quilt and not another
debian-related program that mimicks its behavior? I think that this is
what that dpkg commit induces:
http://anonscm.debian.org/gitweb/?p=dpkg/dpkg.git;a=commit;h=2cb257105366f933a3b9e5ea2647033da12b07f3

Bye, Mt.

-- 
If you're not paying for something, you're not the customer.
You're the product being sold.  --- Andrew Lewis


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#733504: quilt: please sort order of files in diffs ASCIIbetically

2013-12-30 Thread Thorsten Glaser
Martin Quinson dixit:

In lack of this, I blame dpkg for the behavior you saw, not quilt.

No, what I meant is: it got fixed in dpkg, but quilt still writes
diffs with files in arbitrary (as opposed to fixed) order, which
is what I want to fix.

Every program writing a diff that contains changes to more than
one file ought to order those ASCIIbetically by the full pathnames
of the files touched. Only then is working on diffs reliably possible.

bye,
//mirabilos
-- 
«MyISAM tables -will- get corrupted eventually. This is a fact of life. »
“mysql is about as much database as ms access” – “MSSQL at least descends
from a database” “it's a rebranded SyBase” “MySQL however was born from a
flatfile and went downhill from there” – “at least jetDB doesn’t claim to
be a database”  ‣‣‣ Please, http://deb.li/mysql and MariaDB, finally die!


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#733504: quilt: please sort order of files in diffs ASCIIbetically

2013-12-30 Thread Martin Quinson
On Mon, Dec 30, 2013 at 02:43:48PM +, Thorsten Glaser wrote:
 Martin Quinson dixit:
 
 In lack of this, I blame dpkg for the behavior you saw, not quilt.
 
 No, what I meant is: it got fixed in dpkg, but quilt still writes
 diffs with files in arbitrary (as opposed to fixed) order, which
 is what I want to fix.

And I claim that quilt is not doing this. You have to provide some
sort of evidence of the bug, actually.

 Every program writing a diff that contains changes to more than
 one file ought to order those ASCIIbetically by the full pathnames
 of the files touched. Only then is working on diffs reliably possible.

I agree, that's what should be done. That is why quilt does it already. 
If not already done, please read the long version of my previous mail,
not only the TL;DR. This behavior seems impossible in the quilt code.

Did you experience a situation where quilt refresh produced another
order than in the order of patch file for the files already in the
patch, and then alphabetically for the new files ? If so, how could I
reproduce this bug? If not, why did you bug quilt in the first place?


Bye, Mt.

-- 
Let's call it an accidental feature.  -- Larry Wall


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#733504: quilt: please sort order of files in diffs ASCIIbetically

2013-12-30 Thread Thorsten Glaser
Martin Quinson dixit:

And I claim that quilt is not doing this. You have to provide some
sort of evidence of the bug, actually.

$ echo foo foo; echo fnord fnord; echo zulu zulu
$ quilt new bar; quilt add fnord zulu
Patch bar is now on top
File fnord added to patch bar
File zulu added to patch bar
$ echo x fnord; echo x zulu; quilt refresh
Refreshed patch bar
$ # now the bug
$ quilt add foo; echo x foo; quilt refresh
File foo added to patch bar
Refreshed patch bar
$ # and the proof
$ grep '^--- ' patches/bar
--- x.orig/fnord2013-12-30 20:37:22.452881608 +0100
--- x.orig/zulu 2013-12-30 20:37:22.452881608 +0100
--- x.orig/foo  2013-12-30 20:37:22.452881608 +0100

bye,
//mirabilos
-- 
„Also irgendwie hast du IMMER recht. Hier zuckelte gerade ein Triebwagen mit
der Aufschrift Ostdeutsche Eisenbahn durch Wuppertal. Ich glaubs machmal
nicht…“ -- Natureshadow, per SMS
„Hilf mir mal grad beim Denken“ -- Natureshadow, IRL, 2x


--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#733504: quilt: please sort order of files in diffs ASCIIbetically

2013-12-30 Thread Martin Quinson
Thanks a lot for that, this gives me something to work on.
Mt.

On Mon, Dec 30, 2013 at 07:38:40PM +, Thorsten Glaser wrote:
 Martin Quinson dixit:
 
 And I claim that quilt is not doing this. You have to provide some
 sort of evidence of the bug, actually.
 
 $ echo foo foo; echo fnord fnord; echo zulu zulu
 $ quilt new bar; quilt add fnord zulu
 Patch bar is now on top
 File fnord added to patch bar
 File zulu added to patch bar
 $ echo x fnord; echo x zulu; quilt refresh
 Refreshed patch bar
 $ # now the bug
 $ quilt add foo; echo x foo; quilt refresh
 File foo added to patch bar
 Refreshed patch bar
 $ # and the proof
 $ grep '^--- ' patches/bar
 --- x.orig/fnord2013-12-30 20:37:22.452881608 +0100
 --- x.orig/zulu 2013-12-30 20:37:22.452881608 +0100
 --- x.orig/foo  2013-12-30 20:37:22.452881608 +0100
 
 bye,
 //mirabilos
 -- 
 „Also irgendwie hast du IMMER recht. Hier zuckelte gerade ein Triebwagen mit
 der Aufschrift Ostdeutsche Eisenbahn durch Wuppertal. Ich glaubs machmal
 nicht…“   -- Natureshadow, per SMS
 „Hilf mir mal grad beim Denken“   -- Natureshadow, IRL, 2x

-- 
Le sens commun n'est pas si commun (Common sense is not so common).
  -- Voltaire


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#733504: quilt: please sort order of files in diffs ASCIIbetically

2013-12-30 Thread Martin Quinson
Wait a sec. There is no bug in this session!

The file order in the patch is exactly the one I described in my
previous mail: in the order of patch file for the files already in
the patch, and afterward alphabetically for the new files

The patch file order is preserved over the alphabetic one. There is no
reason to change that order. Some people may want to keep the files in
the order they like and I don't see no reason to force them otherwise.

If you want a predictible order of files to reduce the vcs noise,
there is nothing to do, IT ALREADY WORKS.

If you really want the files to be sorted alphabetically, please add
QUILT_REFRESH_ARGS=--sort to your ~/.quiltrc. But I don't see no
reason to force it on all users. Could you enlight me?


What exactly are you expecting from me? Could you please take the time
to do a real mail to explain your problem so that I can help you?

Since the bug report, I digged in dpkg commit log and I explained the
quilt source code to try to help you being more specific about your
problem. I'm getting slowly bored, I must confess. 

I'm thankful for that session, but since you do not specify what would
be the expected behavior and since the actual behavior matches what I
explain since 2 mails, I don't get your point.

Please help me helping you.
Mt.


On Mon, Dec 30, 2013 at 07:38:40PM +, Thorsten Glaser wrote:
 Martin Quinson dixit:
 
 And I claim that quilt is not doing this. You have to provide some
 sort of evidence of the bug, actually.
 
 $ echo foo foo; echo fnord fnord; echo zulu zulu
 $ quilt new bar; quilt add fnord zulu
 Patch bar is now on top
 File fnord added to patch bar
 File zulu added to patch bar
 $ echo x fnord; echo x zulu; quilt refresh
 Refreshed patch bar
 $ # now the bug
 $ quilt add foo; echo x foo; quilt refresh
 File foo added to patch bar
 Refreshed patch bar
 $ # and the proof
 $ grep '^--- ' patches/bar
 --- x.orig/fnord2013-12-30 20:37:22.452881608 +0100
 --- x.orig/zulu 2013-12-30 20:37:22.452881608 +0100
 --- x.orig/foo  2013-12-30 20:37:22.452881608 +0100
 
 bye,
 //mirabilos
 -- 
 „Also irgendwie hast du IMMER recht. Hier zuckelte gerade ein Triebwagen mit
 der Aufschrift Ostdeutsche Eisenbahn durch Wuppertal. Ich glaubs machmal
 nicht…“   -- Natureshadow, per SMS
 „Hilf mir mal grad beim Denken“   -- Natureshadow, IRL, 2x

-- 
The US department of defense should be renamed the US department of
attack. 


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#733504: quilt: please sort order of files in diffs ASCIIbetically

2013-12-29 Thread Thorsten Glaser
Package: quilt
Version: 0.60-2
Severity: important

Hi,

this is the companion bug for the same problem in dpkg-source --commit
reported as: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=689193

The severity in quilt is higher because this is quilt’s primary
objective (managing diffs) and the impact of unsorted patches on
maintainer and reviewer time is nōn-neglegible.

Please sort the order of files in diffs (on “quilt refresh”) by
ascending order of the pathnames involved (do make sure to *not*
use the collation but only the octet values).

I can probably cobble up a patch, should that be needed, but did
not yet do so as I’d have to get familiar with quilt’s internals
first.

Thanks!

-- System Information:
Debian Release: 7.3
  APT prefers unreleased
  APT policy: (500, 'unreleased'), (500, 'stable-updates'), (500, 'stable'), 
(490, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: m68k
i386

Kernel: Linux 3.2.0-4-amd64 (SMP w/1 CPU core)
Locale: LANG=C, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/lksh

Versions of packages quilt depends on:
ii  bsdmainutils  9.0.3
ii  bzip2 1.0.6-4
ii  diffstat  1.55-3
ii  gettext   0.18.1.1-9
ii  patch 2.6.1-3
ii  perl  5.14.2-21+deb7u1

quilt recommends no packages.

Versions of packages quilt suggests:
ii  graphviz2.26.3-14
ii  postfix [mail-transport-agent]  2.9.6-2
pn  procmailnone

-- no debconf information


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#733504: quilt: please sort order of files in diffs ASCIIbetically

2013-12-29 Thread Martin Quinson
On Sun, Dec 29, 2013 at 02:34:24PM +, Thorsten Glaser wrote:
 Package: quilt
 Version: 0.60-2
 Severity: important
 
 Hi,
 
 this is the companion bug for the same problem in dpkg-source --commit
 reported as: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=689193
 
 The severity in quilt is higher because this is quilt’s primary
 objective (managing diffs) and the impact of unsorted patches on
 maintainer and reviewer time is nōn-neglegible.
 
 Please sort the order of files in diffs (on “quilt refresh”) by
 ascending order of the pathnames involved (do make sure to *not*
 use the collation but only the octet values).
 
 I can probably cobble up a patch, should that be needed, but did
 not yet do so as I’d have to get familiar with quilt’s internals
 first.

Hello,

do you know about the quilt refresh --sort option? It seems to be
what you need exactly. From the documentation:

| Sort files by their name instead of preserving the original order.

Could you be please more specific about the issue you are
experiencing? It seems to me that this is the functionality you are
requesting, isn't it?

If you want to see how it works, it's in
/usr/share/quilt/scripts/patchfns , in the definition of
files_in_patch_ordered(). This is used by quilt/refresh instead of
files_in_patch() when the --sort command is passed to refresh.

I checked a bit more, and the documentation is a bit misleading here
as the order of a find is used when --sort is not provided. So this is
not the patch order at all.

Thanks for the report, but I need some more information to fix the
bug, please.

Bye, Mt.


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org