Re: [PATCH 5/9] Refactor excluded and path_excluded
- From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
- Date
- Sep 5, 2012, 10:28 UTC
- Message-ID
- <CACsJy8D23tDa3SJO6yegHFs2hT+bTr6mLTn16ZU3kiT1dtj4vw@mail.gmail.com>
- In-Reply-To
- <7vr4qhbt3d.fsf@alter.siamese.dyndns.org>
On Wed, Sep 5, 2012 at 12:23 AM, Junio C Hamano <gitster@pobox.com> wrote:
Show 21 quoted lines
> Nguyen Thai Ngoc Duy <pclouds@gmail.com> writes: > >> On Sun, Sep 2, 2012 at 7:12 AM, Adam Spiers <git@adamspiers.org> wrote: >>> extern void path_exclude_check_init(struct path_exclude_check *, struct dir_struct *); >>> extern void path_exclude_check_clear(struct path_exclude_check *); >>> +extern struct exclude *path_excluded_1(struct path_exclude_check *, const char *, >>> + int namelen, int *dtype); >>> extern int path_excluded(struct path_exclude_check *, const char *, int namelen, int *dtype); >> >> Exported functions should have nicer names than *_1. No idea what are >> better names though, maybe exclude_path? > > Which part is better? > > Just like between path_excluded_1() and path_excluded() nobody can > tell how they differ (except perhaps the former smells more special > purpose thanks to its funny name) and wouldn't be able to tell which > one to call without looking at their sources, it is hard to tell > path_excluded() and exclude_path() apart. In a sense, that pair is > even worse as there is no hint to suggest which one is more exotic > between them in their names.
We could introduce exclude_path() and kill path_excluded() then. There are just about 5-6 call sites to replace.
-- Duy