Debian Bug report logs - #496828
uses slow find ... -path for java completion

version graph

Package: bash-completion; Maintainer for bash-completion is Gabriel F. T. Gomes <gabriel@debian.org>; Source for bash-completion is src:bash-completion (PTS, buildd, popcon).

Reported by: Benoît Dejean <benoit@placenet.org>

Date: Wed, 27 Aug 2008 20:30:06 UTC

Severity: normal

Tags: confirmed

Fixed in version bash-completion/1:1.0-1

Done: David Paleino <d.paleino@gmail.com>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Andreas Metzler <ametzler@debian.org>:
Bug#496828; Package findutils. (full text, mbox, link).


Acknowledgement sent to Benoît Dejean <benoit@placenet.org>:
New Bug report received and forwarded. Copy sent to Andreas Metzler <ametzler@debian.org>. (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Benoît Dejean <benoit@placenet.org>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: findutils: unexpected -path behaviour
Date: Wed, 27 Aug 2008 22:29:24 +0200
Package: findutils
Version: 4.4.0-2
Severity: normal

Hello,

I use bash-completion.
When i'm in my ~ and want to run a java program,
i type 'java P<tab>' to actually run 'java Prime',
then bash spawns a

find . -type f -path ./P*.class

which takes ~1min to complete and prints as expected './Prime.class'.

stracing find shows than it actually scans my whole home directory

Is it an intented behavior ?
Should i then instead file a bug againt bash-completion ?

Thanks.

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: powerpc (ppc)

Kernel: Linux 2.6.26.3-ibook
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8) (ignored: LC_ALL set to fr_FR.UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages findutils depends on:
ii  libc6                         2.7-13     GNU C Library: Shared libraries

findutils recommends no packages.

Versions of packages findutils suggests:
ii  mlocate                       0.21-1     quickly find files on the filesyst

-- no debconf information




Information forwarded to debian-bugs-dist@lists.debian.org, Andreas Metzler <ametzler@debian.org>:
Bug#496828; Package findutils. (full text, mbox, link).


Acknowledgement sent to "James Youngman" <jay@gnu.org>:
Extra info received and forwarded to list. Copy sent to Andreas Metzler <ametzler@debian.org>. (full text, mbox, link).


Message #10 received at 496828@bugs.debian.org (full text, mbox, reply):

From: "James Youngman" <jay@gnu.org>
To: "Benoît Dejean" <benoit@placenet.org>, 496828@bugs.debian.org
Subject: Re: Bug#496828: findutils: unexpected -path behaviour
Date: Wed, 27 Aug 2008 22:22:55 +0100
On Wed, Aug 27, 2008 at 9:29 PM, Benoît Dejean <benoit@placenet.org> wrote:
> Package: findutils
> Version: 4.4.0-2
> Severity: normal
>
> Hello,
>
> I use bash-completion.
> When i'm in my ~ and want to run a java program,
> i type 'java P<tab>' to actually run 'java Prime',
> then bash spawns a
>
> find . -type f -path ./P*.class

Really!    Yikes!

> which takes ~1min to complete and prints as expected './Prime.class'.
>
> stracing find shows than it actually scans my whole home directory
>
> Is it an intented behavior ?

Well, find is doing what it was told to do.   But what find is being
told to do is likely a bad idea for users who try to use completions
within large directory trees.


> Should i then instead file a bug againt bash-completion ?

I believe so.  You could probably make this more efficient (with a
slight change of result) by changing the find command to something
like this:

find . -maxdepth 1 \( -type f -name 'P*.class' \) -o \( -type d -name 'P*' \)

However, this will not return ./P/Q/R/S/T/foo.class, even if that is
the only class file below the current directory, so there is a change
in functionality in my proposal.

James.




Information forwarded to debian-bugs-dist@lists.debian.org, Andreas Metzler <ametzler@debian.org>:
Bug#496828; Package findutils. (full text, mbox, link).


Acknowledgement sent to Benoît Dejean <benoit@placenet.org>:
Extra info received and forwarded to list. Copy sent to Andreas Metzler <ametzler@debian.org>. (full text, mbox, link).


Message #15 received at 496828@bugs.debian.org (full text, mbox, reply):

From: Benoît Dejean <benoit@placenet.org>
To: James Youngman <jay@gnu.org>, 496828@bugs.debian.org
Cc: control@bugs.debian.org
Subject: Re: Bug#496828: findutils: unexpected -path behaviour
Date: Thu, 28 Aug 2008 00:39:04 +0200
[Message part 1 (text/plain, inline)]
reassign 496828 bash-completion
retitle 496828 uses slow find ... -path for java completion
thanks

Le mercredi 27 août 2008 à 22:22 +0100, James Youngman a écrit :
> On Wed, Aug 27, 2008 at 9:29 PM, Benoît Dejean <benoit@placenet.org> wrote:
> > Package: findutils
> > Version: 4.4.0-2
> > Severity: normal
> >
> > Hello,
> >
> > Should i then instead file a bug againt bash-completion ?
> 
> I believe so.  You could probably make this more efficient (with a
> slight change of result) by changing the find command to something
> like this:
> 
> find . -maxdepth 1 \( -type f -name 'P*.class' \) -o \( -type d -name 'P*' \)
> 
> However, this will not return ./P/Q/R/S/T/foo.class, even if that is
> the only class file below the current directory, so there is a change
> in functionality in my proposal.

Oh, i haven't though about this kind of usage ./P/Q/R/S/T/foo.class.
You are right.

And i don't think the completion should inspect subdirectories.
This becomes a nigthmare on NFS homedirs.

Thanks.
-- 
Benoît Dejean
GNOME http://www.gnomefr.org/
LibGTop http://directory.fsf.org/libgtop.html
[signature.asc (application/pgp-signature, inline)]

Bug reassigned from package `findutils' to `bash-completion'. Request was from Benoît Dejean <benoit@placenet.org> to control@bugs.debian.org. (Wed, 27 Aug 2008 22:42:03 GMT) (full text, mbox, link).


Changed Bug title to `uses slow find ... -path for java completion' from `findutils: unexpected -path behaviour'. Request was from Benoît Dejean <benoit@placenet.org> to control@bugs.debian.org. (Wed, 27 Aug 2008 22:42:04 GMT) (full text, mbox, link).


Tags added: confirmed, pending Request was from David Paleino <d.paleino@gmail.com> to control@bugs.debian.org. (Sat, 06 Sep 2008 14:03:11 GMT) (full text, mbox, link).


Information stored:
Bug#496828; Package bash-completion. (full text, mbox, link).


Acknowledgement sent to David Paleino <d.paleino@gmail.com>:
Extra info received and filed, but not forwarded. (full text, mbox, link).


Message #26 received at 496828-quiet@bugs.debian.org (full text, mbox, reply):

From: David Paleino <d.paleino@gmail.com>
To: 496828-quiet@bugs.debian.org
Cc: 496828-submitter@bugs.debian.org, Bash-Completion Developers <bash-completion-devel@lists.alioth.debian.org>
Subject: Re: Bug#496828: findutils: unexpected -path behaviour
Date: Sat, 6 Sep 2008 15:59:48 +0200
[Message part 1 (text/plain, inline)]
Hello Benoît,

(sorry for missing headers, I'm "manually quoting").

Benoît Dejean wrote:
> I use bash-completion.
> When i'm in my ~ and want to run a java program,
> i type 'java P<tab>' to actually run 'java Prime',
> then bash spawns a
> 
> find . -type f -path ./P*.class

James Youngman wrote:
> find . -maxdepth 1 \( -type f -name 'P*.class' \) -o \( -type d -name 'P*' \)
> 
> However, this will not return ./P/Q/R/S/T/foo.class, even if that is
> the only class file below the current directory, so there is a change
> in functionality in my proposal.

I do really believe we don't want automatic research of classes in
subdirectories. A simple "_filedir" completion should do the trick (obviously,
files restricted to *.class, and all the directories).

So, if foo.class is the only class below the cwd, you'd have to do multiple
<TAB>s, to go in the correct directory where the .class is. Otherwise, that find
command you cited is the only option, to correctly search for .class files.

In the case James cited, would multiple <TAB>s be a desired behaviour? I
believe yes, since one should know where the class file is...

I'm fixing this bug (rev1167) by just adding "-maxdepth 1", but I'll wait for a
reply in case you want me to revert the change. Moreover, a new bug appeared:

$ ls
foo/
foo.class
$ java f<TAB>
$ java foo/

We should give precedence to files over directories, but I don't currently have
idea on how to do that.

To team: before releasing, look at the FIXME in the code, we'd probably better
revert the change if we find no solution.

Kindly,
David

-- 
 . ''`.  Debian maintainer | http://wiki.debian.org/DavidPaleino
 : :'  : Linuxer #334216 --|-- http://www.hanskalabs.net/
 `. `'`  GPG: 1392B174 ----|---- http://snipr.com/qa_page
   `-   2BAB C625 4E66 E7B8 450A C3E1 E6AA 9017 1392 B174
[signature.asc (application/pgp-signature, attachment)]

Message sent on to Benoît Dejean <benoit@placenet.org>:
Bug#496828. (full text, mbox, link).


Reply sent to David Paleino <d.paleino@gmail.com>:
You have taken responsibility. (Sat, 04 Apr 2009 14:12:17 GMT) (full text, mbox, link).


Notification sent to Benoît Dejean <benoit@placenet.org>:
Bug acknowledged by developer. (Sat, 04 Apr 2009 14:12:17 GMT) (full text, mbox, link).


Message #34 received at 496828-close@bugs.debian.org (full text, mbox, reply):

From: David Paleino <d.paleino@gmail.com>
To: 496828-close@bugs.debian.org
Subject: Bug#496828: fixed in bash-completion 1:1.0-1
Date: Sat, 04 Apr 2009 13:47:04 +0000
Source: bash-completion
Source-Version: 1:1.0-1

We believe that the bug you reported is fixed in the latest version of
bash-completion, which is due to be installed in the Debian FTP archive:

bash-completion_1.0-1.diff.gz
  to pool/main/b/bash-completion/bash-completion_1.0-1.diff.gz
bash-completion_1.0-1.dsc
  to pool/main/b/bash-completion/bash-completion_1.0-1.dsc
bash-completion_1.0-1_all.deb
  to pool/main/b/bash-completion/bash-completion_1.0-1_all.deb
bash-completion_1.0.orig.tar.gz
  to pool/main/b/bash-completion/bash-completion_1.0.orig.tar.gz



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 496828@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
David Paleino <d.paleino@gmail.com> (supplier of updated bash-completion package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Fri, 03 Apr 2009 14:21:43 +0200
Source: bash-completion
Binary: bash-completion
Architecture: source all
Version: 1:1.0-1
Distribution: unstable
Urgency: low
Maintainer: Bash Completion Maintainers <bash-completion-devel@lists.alioth.debian.org>
Changed-By: David Paleino <d.paleino@gmail.com>
Description: 
 bash-completion - programmable completion for the bash shell
Closes: 272660 322238 360628 361535 489927 491856 492328 492476 494292 495142 495883 496162 496828 497074 497597 498105 499780 500316 501473 501843 502664 502804 502885 503317 503317 504141 504547 504650 506560 511789 511790 512556 512823 512917 516614 521041
Changes: 
 bash-completion (1:1.0-1) unstable; urgency=low
 .
   * New upstream release:
     - also see /usr/share/doc/bash-completion/CHANGES.gz
     - fix man -l completing filenames (Closes: #497074)
     - (Partly) fixed java classes completion (Closes: #496828). Look for
       FIXME in source.
     - dump to /dev/null error message from look(1) with no arguments
       (Closes: #495142)
     - set ssh as default for rsync (was rsh) (Closes: #492328)
     - added .oga, .ogv, .ogx to mplayer completion (Closes: #496162)
     - added .epub to unzip|zipinfo completion (Closes: #492476)
     - added ssh-copy-id completion (Closes: #491856)
     - moved ssh completion to separate file (Closes: #360628)
     - bogus completion when mounting subdirs fixed (Closes: #322238)
     - fix `apt-cache showsrc` completing only on source package names
       (Closes: #361535)
     - fixed bugs with gdb completion:
     - when an empty directory is in $PATH (thanks to Morita Sho)
       (Closes: #497597)
     - when a non-existing directory is in $PATH (Closes: #499780)
     - fix missing completion for "-n" and "-e" (we were using echo, now
       using printf) (thanks to Morita Sho) (Closes: #498105)
     - fixed gpg completion --@(export|@(?(l|nr|nrl)sign|edit)-key))
       (Closes: #500316)
     - fixed .cb[rz] completion for evince (Closes: #502885)
     - added gpg2 completion (Closes: #489927)
     - fixed mplayer -skin completion (Closes: #501473)
     - fixed errors with POSIX enabled (Closes: #502804)
     - fixed dpkg-source wrong exit() with return() (Closes: #503317)
     - added --schedule-only to aptitude's completion (Closes: #502664)
     - added build-dep to aptitude's completion (Closes: #495883)
     - added support for `-F configfile' to _known_hosts(), ssh, scp and
       sftp, thanks to Freddy Vulto (Closes: #504141)
     - fixed sed quoting bug in _known_hosts(), thanks to Freddy Vulto
       (Closes: #504650)
     - allow for comments in known_hosts files (Closes: #511789)
     - fixed perl -I/-x completion, thanks to Freddy Vulto
       (Closes: #504547)
     - README updated: explain how to use bash-completion correctly.
       (Closes: #506560)
     - added qdbus completion, thanks to Terence Simpson (LP: #257903)
     - fixed completion of environment variables, thanks to Morita Sho
       (Closes: #272660)
     - fix dpkg completion bug: it listed only non-Essential packages
       (Closes: #511790)
     - fixed _dpkg_source completion (Closes: #503317)
     - remove unused UNAME local variable in _info() (Closes: #501843)
     - added .zip to jar completions (Closes: #521041)
     - Merge from Ubuntu:
       + consume error messages in configure completion (LP: #223882)
         (Mika Fischer)
       + quote $xspec in _filedir_xspec in case it is empty, which would
         cause errors if there was no match under failglob. (LP: #194419)
         (Mika Fischer)
     - Ville Skyttä:
       + remove duplicate cpio completion, thanks to Freddy Vulto
         (Closes: #512823)
       + fix awk error in "modprobe -r /" completion (Closes: #512556)
     - Jakob Unterwurzacher:
       + ps2pdf can run on .pdf files as well.
         (Closes: #516614, LP: #316943)
   * debian/links fixed (Closes: #494292)
   * debian/control:
     - fixed typo in the long description
     - added Vcs-* fields
     - Standards-Version to 3.8.1
     - DMUA set
     - removed Luk Claes from Uploaders
     - Homepage added
   * debian/install:
     - correctly install contrib/* under /etc/bash_completion.d/
   * debian/copyright updated
   * debian/extra/dh_bash-completion:
     - updated to support a list of files in debian/<package>.bash-completion
       (Closes: #512917)
   * debian/rules:
     - install upstream CHANGES and AUTHORS too
Checksums-Sha1: 
 977d1414ca3556a4ad46aa2b48b9ca8e6e86a603 1308 bash-completion_1.0-1.dsc
 61040795731f5ff509c46e818a1edf0a7a93e11d 143578 bash-completion_1.0.orig.tar.gz
 49c583802082e3aa9a761fb0da0d5ec257f257bb 9002 bash-completion_1.0-1.diff.gz
 cb38e807d9b23e84b866e6e9d24814991a61836a 103010 bash-completion_1.0-1_all.deb
Checksums-Sha256: 
 d369f9436c02262d3de898564cd9b5269ace760cf6b7e0632e3b251ac431f2b5 1308 bash-completion_1.0-1.dsc
 bd96e7d2858f02783046908a984993736f1189d07d82e9ce4b465068dd7187ef 143578 bash-completion_1.0.orig.tar.gz
 04c46eff31bf9dfb9e79f417bd79706b6dc67888461ab05128b29cff78c9556b 9002 bash-completion_1.0-1.diff.gz
 81ab4b27a2158e787ea39c7da34619858a5df6b6251ba24d8bda6592feed46f4 103010 bash-completion_1.0-1_all.deb
Files: 
 6cb01d355c4519f911820b2b7c0feb53 1308 shells standard bash-completion_1.0-1.dsc
 cd1c5648272917fbe0eef4ba30bb93f4 143578 shells standard bash-completion_1.0.orig.tar.gz
 e78d5e31ed66fb5e97c77ea7c9f1b343 9002 shells standard bash-completion_1.0-1.diff.gz
 aefc9e1c8db0f4f2b61557c2e207ca0c 103010 shells standard bash-completion_1.0-1_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAknXYZAACgkQ5UTeB5t8Mo0jGACfQVygJmdQ3v4i/dymRnZSVnhA
qHoAnjcS99HMQgFHzQ2NnNAY1OPvlPK6
=6i7t
-----END PGP SIGNATURE-----





Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Wed, 13 May 2009 07:28:34 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sun Jul 2 10:03:50 2023; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.