Ticket #2491 (closed defect: fixed)

Opened 6 years ago

Last modified 5 years ago

"Find File" should display relative paths for relative search

Reported by: curtis Owned by: andrew_b
Priority: major Milestone: 4.8.0-pre1
Component: mc-core Version: 4.7.5
Keywords: Cc: gotar@…
Blocked By: Blocking:
Branch state: merged Votes for changeset: committed-master committed-stable

Description

The results of a file find display whole paths, but should instead display relative path.

I'm already in /home/curtis/src/mc/mc.git. Even the left pane displays ~/src/mc/mc.git.

Example attached. It displays /home/curtis/src/mc/mc.git/src/filemanager when it should just display src/filemanager path.

Attachments

ScreenShot132.png (14.7 KB) - added by curtis 6 years ago.
Find File shoudn't display full paths like this

Change History

Changed 6 years ago by curtis

Find File shoudn't display full paths like this

comment:1 in reply to: ↑ description ; follow-up: ↓ 2 Changed 6 years ago by andrew_b

  • Status changed from new to closed
  • Version 4.7.5 deleted
  • Resolution set to wontfix
  • Milestone 4.8 deleted

Replying to curtis:

The results of a file find display whole paths, but should instead display relative path.

Why?

Sorry, but no.

comment:2 in reply to: ↑ 1 Changed 6 years ago by curtis

  • Status changed from closed to reopened
  • Resolution wontfix deleted
  • Summary changed from "Find File" should display relative paths to "Find File" should display relative paths for relative search

Replying to andrew_b:

Replying to curtis:

The results of a file find display whole paths, but should instead display relative path.

Why?

Because when searching for a relative path, prepending the full/explicit subdirs has the potential to makes the display unnecessarily long and clutters the screen.

So correction: it should display relative paths when the "Start at:" is a relative path such as "." instead of an explicit/full path.

This is a request to have old mc-like behavior back. But maybe better? :-)

For example, if the pane/focus is already in /home/curtis/src/mc and one searches in "." for files containing "CAREFUL_ALIGNMENT" then the results should be listed in:

./mc.git/lib/vfs/mc-vfs/samba/include

Not in:

/home/curtis/src/mc/mc.git/lib/vfs/mc-vfs/samba/include  

However, it one searches in "/home/curtis/src/mc" instead of "." then the latter result is appropriate.

comment:3 Changed 6 years ago by andrew_b

Patches are welcome!

comment:4 Changed 6 years ago by gotar

  • Cc gotar@… added

comment:5 Changed 5 years ago by andrew_b

  • Status changed from reopened to closed
  • Resolution set to wontfix

comment:6 Changed 5 years ago by gotar

  • Priority changed from minor to major
  • Type changed from enhancement to defect
  • Status changed from closed to reopened
  • Resolution wontfix deleted

It used to work properly until f5a93bf74ca1048433b6ad687e4fd773c1b69ce3:

f5a93bf74ca1048433b6ad687e4fd773c1b69ce3 is the first bad commit
commit f5a93bf74ca1048433b6ad687e4fd773c1b69ce3
Author: Andrew Borodin <aborodin@vmail.ru>
Date:   Fri Nov 5 15:38:11 2010 +0300

    Fix of directory ignorance in file find engine.
    
    Start directory is used and displayed now as absolute path.

:040000 040000 5153de54259688d254e2d0f22fc71b4608e349c9 8960166b28f074bb917018552b8b14bca5df1a40 M      src

Now panelize results are useless in most cases. If one searches within relative location he wants relative results, that's how every other tool works and mc has worked till 4.7.4.

comment:7 Changed 5 years ago by gotar

The same changeset has broken left arrow (of lynx-like motion) from panelization of directories having files only (without any subdirs). Steps to reproduce:

  1. mkdir -p a/{b/c,d}
  2. touch a/d/e
  3. cd a/b
  4. mc
  5. alt-shift-/ enter l left - selection points to 'b' directory (as it should)
  6. down, enter, alt-shift-/ enter l left - selection points to '..' instead of 'd'

comment:8 follow-up: ↓ 9 Changed 5 years ago by andrew_b

Absolute paths was implemented to fix #2366. Till 4.7.5, the ignorance of paths was partially broken.

Support of absolute and relative paths in ignore_dir (#2275) as well as in file find engine (#2491), using each path as is, makes the algorithm too complex and intricate. The path comparision is required to deсide whether the current path will be processed or not. To compare abs and rel paths with any combination, you have to convert one of them to form of another: abs to rel or vice versa and make that each time during search process. Each such conversion requires some time and and makes find process slower. Therefore absolute paths are used to get a something like "origin of coordinates" and minimize rel to abs and abs to real conversions.

comment:9 in reply to: ↑ 8 ; follow-up: ↓ 10 Changed 5 years ago by gotar

I remember those issues, you can find me in CC there. I don't say that anything should be changed in path comparision (search engine), only in panelization (i.e. displaying results, and comment:7 of course).

BTW does ignore_dir support wildchars?

comment:10 in reply to: ↑ 9 Changed 5 years ago by andrew_b

Replying to gotar:

does ignore_dir support wildchars?

No.

comment:11 Changed 5 years ago by andrew_b

  • Keywords stable-candidate added
  • Version set to 4.7.5
  • severity changed from no branch to on review
  • Milestone set to 4.8.0-pre1

Created 2491_find_file_relative_paths branch. Parent: master.
Initial changeset:37f89ba89cfc265a20c0b53d4a1dec086c1e4c14

Version 0, edited 5 years ago by andrew_b (next)

comment:12 Changed 5 years ago by slavazanko

  • Owner set to andrew_b
  • Status changed from reopened to assigned

comment:13 Changed 5 years ago by slavazanko

  • severity changed from on review to no branch
  • Branch state set to on review

comment:14 Changed 5 years ago by slavazanko

  • Votes for changeset set to slavazanko

comment:15 Changed 5 years ago by angel_il

  • Votes for changeset changed from slavazanko to slavazanko angel_il
  • Branch state changed from on review to approved

comment:16 Changed 5 years ago by andrew_b

  • Status changed from assigned to testing
  • Votes for changeset changed from slavazanko angel_il to committed-master
  • Resolution set to fixed
  • Branch state changed from approved to merged

Merged to master.
changeset:a4af63e82780fa81d6c512145b3d8f614acf09e7

git log --pretty=oneline 381db14..a4af63e

comment:17 Changed 5 years ago by andrew_b

  • Branch state changed from merged to on review

Created 2491_find_file_relative_paths_stable branch (parent: 4.7.5-stable).
Initial changeset:1195900395cbb171740bf923380e81c62e064428

Review please.

comment:18 Changed 5 years ago by angel_il

  • Votes for changeset changed from committed-master to angel_il

comment:19 Changed 5 years ago by slavazanko

  • Votes for changeset changed from angel_il to angel_il slavazanko
  • Branch state changed from on review to approved

comment:20 Changed 5 years ago by andrew_b

  • Status changed from testing to closed
  • Keywords stable-candidate removed
  • Votes for changeset changed from angel_il slavazanko to committed-master committed-stable
  • Branch state changed from approved to merged

Merged to 4.7.5-stable.
changeset:a733bd432121b20a304321ab5ba8e5f00e05c690

git log --pretty=oneline 109a6fb..a733bd4
Note: See TracTickets for help on using tickets.