REST API support to fetch filenames from a repo

207 views
Skip to first unread message

Anurag Aravala

unread,
Apr 7, 2021, 2:54:50 AM4/7/21
to Repo and Gerrit Discussion
Hello all, can anyone help me with a way to get filenames from a remote repository without cloning the repository as cloning thousands of repos for just filenames is not desirable for our project

Edwin Kempin

unread,
Apr 7, 2021, 2:56:45 AM4/7/21
to Anurag Aravala, Repo and Gerrit Discussion
On Wed, Apr 7, 2021 at 8:54 AM Anurag Aravala <anurag....@gmail.com> wrote:
Hello all, can anyone help me with a way to get filenames from a remote repository without cloning the repository as cloning thousands of repos for just filenames is not desirable for our project

There is the List Files REST endpoint [1], maybe you can use this API.

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/bf0e904e-b0c2-4230-9c92-c63d80942935n%40googlegroups.com.

Anurag Aravala

unread,
Apr 7, 2021, 1:47:06 PM4/7/21
to Repo and Gerrit Discussion
That endpoint gives only files which were modified in the commit but not all those present in the repo. If it's not possible through Gerrit rest api, please help me with any other possible way.

Fabio Ponciroli

unread,
Apr 8, 2021, 3:24:47 AM4/8/21
to Anurag Aravala, Repo and Gerrit Discussion
Il giorno mer 7 apr 2021 alle ore 19:47 Anurag Aravala <anurag....@gmail.com> ha scritto:
That endpoint gives only files which were modified in the commit but not all those present in the repo. If it's not possible through Gerrit rest api, please help me with any other possible way.

If you are using gitiles [1] you could think of leveraging the UI to scrape your repository. Not sure if it is easier than just cloning the repositories and do something like [2]:

git clone --no-checkout --depth 1 https://github.com/torvalds/linux .
git ls-tree --full-name --name-only -r HEAD | head

HTH.

Thanks,
Ponch

 
On Wednesday, April 7, 2021 at 12:26:45 PM UTC+5:30 Edwin Kempin wrote:
On Wed, Apr 7, 2021 at 8:54 AM Anurag Aravala <anurag....@gmail.com> wrote:
Hello all, can anyone help me with a way to get filenames from a remote repository without cloning the repository as cloning thousands of repos for just filenames is not desirable for our project

There is the List Files REST endpoint [1], maybe you can use this API.

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/repo-discuss/bf0e904e-b0c2-4230-9c92-c63d80942935n%40googlegroups.com.

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.

Anurag Aravala

unread,
Apr 9, 2021, 2:35:20 AM4/9/21
to Repo and Gerrit Discussion
Getting <h1>Cannot Parse as Gitiles URL</h1> while trying to scrape the Page source . Does anyone has any idea about this ?
Reply all
Reply to author
Forward
0 new messages