{"thread":{"id":"63231","subject":"[ITCH] Redundant rebuilds when rebasing outdated branch","startedAt":"2025-04-01T10:55:32Z","lastAt":"2025-04-01T23:44:40Z","messageCount":2,"participants":["Ramkumar Ramachandra","brian m. carlson"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"515421","messageId":"4f142817-49a7-4079-b7b1-e54de36a6242@app.fastmail.com","threadId":"63231","inReplyTo":null,"subject":"[ITCH] Redundant rebuilds when rebasing outdated branch","fromName":"Ramkumar Ramachandra","fromEmail":"r@artagnon.com","sentAt":"2025-04-01T10:54:15Z","receivedAt":"2025-04-01T10:55:32Z","isPatch":false,"sender":{"key":"r@artagnon.com","avatar":"https://avatars.githubusercontent.com/u/37226?v=4"},"body":"Hi,\n\nI've noticed a common pattern in my everyday work, and thought I should ask if I'm doing something stupid. I work on upstream LLVM, and develop patches on different branches based off 'main'. Due to the nature of our collaboration, I often need to update 'main' and rebase patches, when some patches land. As a consequence, different patches are based on different points of 'main', and I find myself checking out an outdated branch, rebasing it on top of 'main' (which often doesn't result in conflicts), and this triggers a rebuild because the timestamps changed. Since LLVM is a huge project, I use ccache to speed up my builds, but this doesn't solve the problem of redundant rebuilds, since CMake often needs to be reconfigured, and several built artifacts are generated using home-grown tools.\n\nI think it would be preferable to have something like 'git rebase-checkout', which in principle, creates a new branch based off 'main', cherry-picks commits off the outdated branch, and renames the fresh branch into the outdated branch's name. It should be possible to script this using the existing plumbing, but I was wondering if something like this would be useful to have in core git?\n\nThanks.\n\nRam\n"},{"id":"515473","messageId":"Z-x6Zt7ljBj3RhSX@tapette.crustytoothpaste.net","threadId":"63231","inReplyTo":"4f142817-49a7-4079-b7b1-e54de36a6242@app.fastmail.com","subject":"Re: [ITCH] Redundant rebuilds when rebasing outdated branch","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2025-04-01T23:44:38Z","receivedAt":"2025-04-01T23:44:40Z","isPatch":false,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2025-04-01 at 10:54:15, Ramkumar Ramachandra wrote:\n> I think it would be preferable to have something like 'git rebase-checkout', which in principle, creates a new branch based off 'main', cherry-picks commits off the outdated branch, and renames the fresh branch into the outdated branch's name. It should be possible to script this using the existing plumbing, but I was wondering if something like this would be useful to have in core git?\n\nI think `git replay` might do what you want.  It operates as a\nnon-interactive rebase which leaves the working tree and index\nuntouched, and updates no references (although it's designed to be piped\nto `git update-ref --stdin`).  It is experimental, though.\n-- \nbrian m. carlson (they/them)\nToronto, Ontario, CA\n"}]}