[PR #4921] [MERGED] Optimize pulls merging #17548

Closed
opened 2025-11-02 13:59:33 -06:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-gitea/gitea/pull/4921
Author: @typeless
Created: 9/12/2018
Status: Merged
Merged: 1/23/2019
Merged by: @lafriks

Base: masterHead: merge-without-full-worktree


📝 Commits (10+)

  • d4fe971 Optimize pulls merging
  • c2f7a28 Use sparse-checkout to speedup pulls merge
  • 03c126d Use bytes.Buffer instead of strings.Builder for backward compatibility
  • c7a509f Fix empty diff-tree output for repos with only the initial commit
  • 5a3c10b Fix missing argument for the format string
  • 23d1f55 Rework diff-tree-list generation
  • f67dd1b Remove logging code
  • 1b9d699 File list for sparse-checkout must be prefix with /
  • 3c6b43c Update onto the rebased head
  • 70dc42c Use referecen repo to avoid fetching objects

📊 Changes

1 file changed (+86 additions, -16 deletions)

View changed files

📝 models/pull.go (+86 -16)

📄 Description

This is yet-another attempt to fix #601.

It passes the integration tests but not sure if it is sufficiently covered.

Benchmarking is not trivial to be automated within the existing testing framework because

  1. Adding a large test repo inside Gitea's integration facility is not desirable.
  2. Cloning an existing large repo from somewhere on the internet is very time-consuming and not appropriate to be run repeatedly.
  3. Testing small repo seems to be unreliable and I keep getting interrupted by 'database table is locked' along the way when looping through the pull merging test.

I still published this patch in hopes that someone can find any flaws early.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-gitea/gitea/pull/4921 **Author:** [@typeless](https://github.com/typeless) **Created:** 9/12/2018 **Status:** ✅ Merged **Merged:** 1/23/2019 **Merged by:** [@lafriks](https://github.com/lafriks) **Base:** `master` ← **Head:** `merge-without-full-worktree` --- ### 📝 Commits (10+) - [`d4fe971`](https://github.com/go-gitea/gitea/commit/d4fe971f4639671d3f1af360bbe19fd0735fc295) Optimize pulls merging - [`c2f7a28`](https://github.com/go-gitea/gitea/commit/c2f7a287291ec1d420e7a9ff27e0e494b106cd69) Use sparse-checkout to speedup pulls merge - [`03c126d`](https://github.com/go-gitea/gitea/commit/03c126d72bbef989c449bb1eb0d145170e5b8179) Use bytes.Buffer instead of strings.Builder for backward compatibility - [`c7a509f`](https://github.com/go-gitea/gitea/commit/c7a509fd9d7a62d39a77a6f92bd39c20c60ac6d3) Fix empty diff-tree output for repos with only the initial commit - [`5a3c10b`](https://github.com/go-gitea/gitea/commit/5a3c10b3c720656b26fcb8d9956ad84075517da6) Fix missing argument for the format string - [`23d1f55`](https://github.com/go-gitea/gitea/commit/23d1f557633ebdd20197e3c107c43771ce656d7b) Rework diff-tree-list generation - [`f67dd1b`](https://github.com/go-gitea/gitea/commit/f67dd1b2960cd380f2c50b7fef175383b860b5cc) Remove logging code - [`1b9d699`](https://github.com/go-gitea/gitea/commit/1b9d6998bf1fb0f3f6f0a15e9b71bbf975008b06) File list for sparse-checkout must be prefix with / - [`3c6b43c`](https://github.com/go-gitea/gitea/commit/3c6b43c9c99883bb484291908c12430d0575a1ed) Update onto the rebased head - [`70dc42c`](https://github.com/go-gitea/gitea/commit/70dc42c5d5bbacb65c31f8d79e846565a98ce05e) Use referecen repo to avoid fetching objects ### 📊 Changes **1 file changed** (+86 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `models/pull.go` (+86 -16) </details> ### 📄 Description This is yet-another attempt to fix #601. It passes the integration tests but not sure if it is sufficiently covered. Benchmarking is not trivial to be automated within the existing testing framework because 1. Adding a large test repo inside Gitea's integration facility is not desirable. 2. Cloning an existing large repo from somewhere on the internet is very time-consuming and not appropriate to be run repeatedly. 3. ~Testing small repo seems to be unreliable and I keep getting interrupted by 'database table is locked' along the way when looping through the pull merging test.~ I still published this patch in hopes that someone can find any flaws early. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2025-11-02 13:59:34 -06:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#17548