line / line/centraldogma

Set max depth when cloning a git repository

Open
#576 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

new feature
Dominant language
Java
Stars
668
Forks
135
Avg merge
4d 19h
Merged PRs (30d)
7

Description

To support multiple sub-repositories, which mentioned in #575, we need to copy a snapshot of the existing git repository to a new one with truncating the original histories.
`GitRepository` already has some APIs that clones a git repository to another directory. However, it can not limit the number of max histories.
https://github.com/line/centraldogma/blob/1ceed8a869d364e2b6fd12ae1bbbc0fb0c83f292/server/src/main/java/com/linecorp/centraldogma/server/internal/storage/repository/git/GitRepository.java#L1593-L1598

It seems like a good idea to handle this issue first before proceeding with #575.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in server/src/main/java/com/linecorp/centraldogma/server/internal/storage/repository/git/GitRepository.java around lines 1593-1598 and inspect the existing repository-cloning APIs. Determine how the clone operation can limit history depth, then verify that copying a repository produces a snapshot with the requested maximum history depth before proceeding with #575.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, java
Domain
backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.