git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Remove duplicate pathspecs from ls-files command line

From
David Kastrup <dak@gnu.org>
Date
Aug 29, 2007, 21:36 UTC
Message-ID
<85tzqic9bf.fsf@lola.goethe.zz>
In-Reply-To
<20070829211519.GE11824@steel.home>
Alex Riesen <raa.lkml@gmail.com> writes:
Show 7 quoted lines
> Junio C Hamano, Wed, Aug 29, 2007 22:44:22 +0200:
>> 
>> That loop is plain old O(n^2) that penalizes everybody.
>> 
>
> Maybe something in pathspec matching code could be reused to notice
> the duplications? It has to go through all of them anyway...

Does anything speak against sorting the pathspecs? That is an O(n log n) operation, and dup detection is trivial afterwards.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum
Previous: Alex RiesenNext: Junio C Hamano
Message 6 of 9 in “double occurrence of filenames on command lines”
  1. martin f krafftAug 29, 2007
  2. Remove duplicate pathspecs from ls-files command lineAlex Riesen, Aug 29, 2007
  3. Junio C HamanoAug 29, 2007
  4. martin f krafftAug 29, 2007
  5. Alex RiesenAug 29, 2007
  6. David KastrupAug 29, 2007
  7. Junio C HamanoAug 30, 2007
  8. David KastrupAug 30, 2007
  9. martin f krafftAug 29, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.