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

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

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 30, 2007, 01:25 UTC
Message-ID
<7vr6llak4h.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<85tzqic9bf.fsf@lola.goethe.zz>
David Kastrup <dak@gnu.org> writes:
> Does anything speak against sorting the pathspecs?  That is an O(n log
> n) operation,

Not sorting is O(0) operation without losing cycles for the normal case. I think you can sort first in that error handling path to avoid O(n^2) but sorting upfront to remove duplicates for every case is unnecessary bloat that penalizes sane callers.

Previous: David KastrupNext: David Kastrup
Message 7 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.