From: Kaartic Sivaraam Date: Sun, 08 Aug 2021 19:23:31 GMT Subject: Re: [GSoC] [PATCH v4 4/8] dir: libify and export helper functions from clone.c Message-ID: <1b731c17-7284-746d-331b-d0edd5823318@gmail.com> In-Reply-To: <20210807071613.99610-5-raykar.ath@gmail.com> On 07/08/21 12:46 pm, Atharva Raykar wrote: >> [ ... ] > > diff --git a/dir.h b/dir.h > index b3e1a54a97..a4a6fd7371 100644 > --- a/dir.h > +++ b/dir.h > @@ -453,6 +453,16 @@ static inline int is_dot_or_dotdot(const char *name) > > int is_empty_dir(const char *dir); > > +/* > + * Retrieve the "humanish" basename of the given Git URL. > + * > + * For example: > + * /path/to/repo.git => "repo" > + * host.xz.foo/.git => "foo" > + */ Are you sure about the examples here? I just tried and ... - '/path/to/repo.git' gave me 'repo' like you said .. but .. - 'host.xz.foo/.git' gives me 'host.xz.foo' instead of 'foo'. I think you meant to have 'host.xz/foo.git' in the example. Also, here's another example that might be useful to mention in the docstring: - 'http://example.com/user/bar.baz' => 'bar.baz' > +char *git_url_basename(const char *repo, int is_bundle, int is_bare); > +void strip_dir_trailing_slashes(char *dir); > + > void setup_standard_excludes(struct dir_struct *dir); > > char *get_sparse_checkout_filename(void); > -- Sivaraam