nextcloud / backportbot

A bot designed to streamline the process of backporting pull requests or specific commits to older branches
GNU Affero General Public License v3.0
10 stars 8 forks source link

feat: Use work trees instead of copying the whole directory #553

Closed susnux closed 1 month ago

susnux commented 1 month ago

This should speed up backports by not copying the repository but create a clean work tree with the required branches set.

Best reviewed without whitespace: https://github.com/nextcloud/backportbot/pull/553/files?diff=split&w=1

skjnldsv commented 1 month ago

Did you encounter some slow backports @susnux ? What made you start this PR?

susnux commented 1 month ago

What made you start this PR?

The recent backport bot issues with dirty repository. Using worktrees will never touch the "original" repository, moreover it does not require to copy all ~4GB of the .git directory.

skjnldsv commented 1 month ago

The recent backport bot issues with dirty repository. Using worktrees will never touch the "original" repository

The original cached repository was never touched before. :) The issue was different.

Everything runs on ssd, copying 4GB takes barely a few seconds. I'm not against this, but I'm too unfamiliar with the git worktree :grimacing:

susnux commented 1 month ago

Yeah saw that, but then I already starting using worktrees and I thought maybe you consider this a nice to have (not sure on what hardware this runs but probably copying 4GB takes always quite some time :sweat_smile: But feel free to dismiss this PR if you do not think so - would be ok for me too^^

skjnldsv commented 1 month ago

I would rather merge it and deploy it on a day you and i are both ready to focus on it in case something needs adjusting if that's ok :+1:

susnux commented 1 month ago

I would rather merge it and deploy it on a day you and i are both ready to focus on it in case something needs adjusting if that's ok 👍

Conference?