jenkinsci / plugin-modernizer-tool

MIT License
9 stars 7 forks source link

Optimize Repository Forking Process #104

Open gounthar opened 3 months ago

gounthar commented 3 months ago

What feature do you want to see added?

Current Situation

When forking a repository on GitHub, our current process retrieves all branches from the original repository.

Issue

This approach may be inefficient and unnecessary for our use case.

Desired Outcome

We aim to fork only the default branch of the repository, as this is typically sufficient for our work.

GitHub GUI Option

The GitHub web interface provides an option to fork only the default branch (usually the main branch).

JGit Consideration

It's unclear whether JGit, the Java library we use for Git operations, offers a similar option to fork only the default branch.

Proposed Solution

  1. Investigate if JGit provides functionality to fork only the default branch.
  2. If available, implement this feature in our forking process.
  3. If not available through JGit, explore alternative methods to achieve this goal.

Benefits

  1. Efficiency: Reduces unnecessary data transfer and storage.
  2. Simplicity: Maintains a cleaner repository structure in our forks.
  3. Focus: Aligns with our primary need of working with the main branch.

Next Steps

  1. Research JGit documentation and community resources for potential solutions.
  2. If no direct JGit solution exists, consider implementing a custom approach to achieve the desired outcome.
  3. Test and validate any new implementation to ensure it doesn't introduce unforeseen issues.

Conclusion

Optimizing our forking process to retrieve only the main branch will streamline our workflow and improve overall efficiency. This change aligns with best practices for managing forks when only the main branch is needed for development or analysis purposes.

Upstream changes

No response

Are you interested in contributing this feature?

No response

lemeurherve commented 3 months ago

You might not even need all commits from the primary branch (which can be "master") but only the last one.

gounthar commented 3 months ago

Yes indeed.