Skip to content

Do we support listing all files/directories under multiple given paths #34839

Closed
@rickyma

Description

@rickyma

Description

Title: Feature Request: List All Files/Directories Under Multiple Given Paths

Description:

Hi,

I would like to request a feature that allows users to input multiple directories or files, and then returns a list of all subdirectories or files under these given paths.

Use Case Example:

Suppose I have the following directories:

  • /a/b/c-dir
  • /a/b/d-dir
  • /a/b/e-dir

I want to get a list of all files (with their metadata or content optional) and subdirectories under these directories, for example:

  • /a/b/c-dir/f
  • /a/b/d-dir/x
  • /a/b/e-dir/z
  • /a/b/e-dir/y

/repos/{owner}/{repo}/file-contents does not return the files under a requested directory? Instead it returns the directory itself.

It would be great if the feature could support:

  • Listing only the first level of files/subdirectories, or
  • Recursively listing all files/subdirectories under the given paths (configurable).

Summary of Requirements:

  • Input: Multiple directories or files.
  • Output: A list of all files and/or subdirectories under each input path.
  • Option to choose between listing only the first level or recursively listing all levels.

This feature would be very helpful for users who need to quickly view or process the contents of multiple directories at once. Better performance.

Thank you!

Gitea Version

latest

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

./gitea web

Database

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic/apiConcerns mainly the APItype/featureCompletely new functionality. Can only be merged if feature freeze is not active.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions