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

Re: [PATCH/RFC] Makefile: dedup list of files obtained from ls-files

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 22, 2019, 06:11 UTC
Message-ID
<xmqq8sw28t7v.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<CAPig+cR5yMtdBA0HgLZ6k-j3NeMS+4UeEKgRiEpZ0YGrW_L0cg@mail.gmail.com>
Eric Sunshine <sunshine@sunshineco.com> writes:
Show 15 quoted lines
> On Sun, Apr 21, 2019 at 9:19 AM Junio C Hamano <gitster@pobox.com> wrote:
>> diff --git a/Makefile b/Makefile
>> @@ -822,12 +822,12 @@ VCSSVN_LIB = vcs-svn/lib.a
>> -LIB_H := $(shell git ls-files '*.h' ':!t/' ':!Documentation/' 2>/dev/null || \
>> +LIB_H := $(shell (git ls-files '*.h' ':!t/' ':!Documentation/' 2>/dev/null || \
>>         $(FIND) . \
>>         -name .git -prune -o \
>>         -name t -prune -o \
>>         -name Documentation -prune -o \
>> -       -name '*.h' -print)
>> +       -name '*.h' -print) | sort -u)
>
> GNU make's "sort" function also de-dups, so an alternative is:
>
>     LIB_H := $(sort $(shell ...))
That is a much better solution.  Let me use that.
Thanks.
Previous: Eric SunshineNext: Jeff King
Message 3 of 11 in “Makefile: dedup list of files obtained from ls-files”
  1. Makefile: dedup list of files obtained from ls-filesJunio C Hamano, Apr 21, 2019
  2. Eric SunshineApr 22, 2019
  3. Junio C HamanoApr 22, 2019
  4. Jeff KingApr 22, 2019
  5. Ramsay JonesApr 22, 2019
  6. Junio C HamanoApr 23, 2019
  7. SZEDER GáborApr 23, 2019
  8. Junio C HamanoApr 24, 2019
  9. SZEDER GáborApr 24, 2019
  10. Eric SunshineApr 24, 2019
  11. Junio C HamanoApr 25, 2019

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.