Skip to content

Conversation

@Kobzol
Copy link
Member

@Kobzol Kobzol commented Jan 16, 2026

Second attempt, this time using libgit2 to perform the push of the squashed commit to a fork, and with tests.

I hid the libgit2 dependency behind a feature, to make it easier for contributors who can't build that dependency (although it is enabled by default).

@Kobzol Kobzol marked this pull request as ready for review January 16, 2026 20:57
@Kobzol Kobzol enabled auto-merge January 16, 2026 20:58
@Kobzol Kobzol added this pull request to the merge queue Jan 16, 2026
// Create the squashed commit on the source repository.
// We take the parents of the first commit, and the tree of the last commit, to create the
// squashed commit.
let commit_msg = &pr.github.title;
Copy link
Member

@bjorn3 bjorn3 Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would lose the original commit messages. I don't know of an easy heuristic for that though. Another option may be to pick the PR description and remove the bors ignored part, all closes commands and the r?. Or maybe allow giving the commit message as argument to @bors squash?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I implemented this as an MVP, mostly to check permissions. There is a pretty big design aspect left, and that is how to generate the commit message, exactly as you say 😆 Let's discuss that on Zulip.

@rustbot
Copy link
Collaborator

rustbot commented Jan 16, 2026

Error: This repository is not enabled to use triagebot.
Add a triagebot.toml in the root of the default branch to enable it.

Please file an issue on GitHub at triagebot if there's a problem with this bot, or reach out on #triagebot on Zulip.

1 similar comment
@rustbot
Copy link
Collaborator

rustbot commented Jan 16, 2026

Error: This repository is not enabled to use triagebot.
Add a triagebot.toml in the root of the default branch to enable it.

Please file an issue on GitHub at triagebot if there's a problem with this bot, or reach out on #triagebot on Zulip.

Merged via the queue into rust-lang:main with commit bd900af Jan 16, 2026
3 checks passed
@Kobzol Kobzol deleted the bors-squash branch January 16, 2026 21:16
// Fetch the commit from the source repo
source_remote
.fetch(&[commit_sha.as_ref()], Some(&mut fetch_options), None)
.with_context(|| anyhow::anyhow!("Cannot fethc commit {commit_sha} from {source_repo}"))?;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't this clone the entire repo? Can you use fetch_options.depth(1) to at least skip all history? Looks like libgit2 doesn't support partial clones though, so you can't do the equivalent of --filter=tree:0 to avoid downloading any blobs and trees at all.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...crap, I thought it was too easy. Yeah, this will have to be handled somehow (possibly with a disk cache :( ).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants