Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] using the JGit library to get a list of all the files from a remote repository

Thanks for the answer.

ok for doing a depth1.
according to the protocol, is is possible to just download the name of the files,
or it is required to download all the content of the files as well?

> A better question might be "why are you trying to get a list of files" ...
I agree ;)
we have many projects which dependencies among them, and sometimes it is a bit difficult to find the real source of a class or xsd.
having a list of all the files from all the projects/repositories helped a bit; i did that with a cron job with svn list -r url, for each repository.


On Mon, May 27, 2013 at 3:50 PM, Alex Blewitt <alex.blewitt@xxxxxxxxx> wrote:
You are correct that the Git protocol does not do this.

However you could clone with a depth of 1 which would allow you to iterate through the tree and save downloading the history.

git clone --depth 1 url

I don't think that the JGit API supports a depth restriction.

You could speed it up a little by not doing a checkout afterwards, but that's about it for speeding it up.

A better question might be "why are you trying to get a list of files" ...


Sent from my iPhone 5

On 27 May 2013, at 13:39, David Portabella <david.portabella@xxxxxxxxx> wrote:

> with svn we can get a list of all the files in a remote repository without checking out the contents locally, with svn list <url>.
> if i understood it correctly, the git client/protocol does not allow this possibility.
> so, i would need to do as follows:
> git clone <url>
> git ls-tree -r --name-only remotes/origin/master
> however, this means that I need to download all the files locally.
> is it possible create a program that lists all the files, without downloading all the files?
> or according to the git procotol, it is impossible to get such a list without downloading the content of all the files?
> if it is possible, can this be done with the JGit library?
> any help in this direction?
> Regards,
> David
> _______________________________________________
> jgit-dev mailing list
> jgit-dev@xxxxxxxxxxx

Back to the top