Skip to content

Conversation

@tgross35
Copy link
Contributor

As a resolution to #271, vendor the multipart crate https://github.com/abonander/multipart.

This is merged with the same method I used to get ctest into libc, using git filter-repo to rewrite history to a subdirectory and rewrite issue mentions in commit messages to point to the upstream repo. More details and steps to reproduce are in the merge commit 672b1f1.

After the merge, the FCWs are fixed by switching multipart from buf-redux to buffer-redux (the maintained fork) and applying @MightyPork's patch from #271, plus a few updates so it builds with default features

Finally, the merged crate is renamed to rouille-multipart so it can be published as a new crate. I think it would be good to strip out all features that rouille does not need before publishing, but that is easiest done as a follow up.

…d_macro_def

Remove unused macro definition
… unaccessible super; add entry API to local_test
abonander and others added 19 commits January 28, 2019 14:33
upgrade mime & mime_guess to latest version
…TSEC-2019-0035

Bump rand to 0.7 to address RUSTSEC-2019-0035
Absorb the `multipart` repository into `rouille`.

This was done using `git-filter-repo` to ensure hashes mentioned in
commit messages were correctly rewritten. Approximately:

    # `git filter-repo` requires a clean clone
    git clone https://github.com/abonander/multipart.git
    cd multipart

    # Move all code to a `multipart` subdirectory for all history
    git filter-repo --to-subdirectory-filter multipart

    # The default merge messages are "merge pull request #nnn from
    # user/branch". GH links these incorrectly in the new repo, so
    # rewrite messages and issue links from `#nnn` to
    # `abonander/multipart#nnn`.
    echo 'regex:(^|\s)(#\d+\s)==>\1abonander/multipart\2' > messages.txt
    git filter-repo --replace-message messages.txt

    # Re-add a remote and push as a new branch
    git remote add me https://github.com/tgross35/rouille.git
    git switch -c multipart-merge-prep
    git push --set-upstream me multipart-merge-prep

    # Now in the rouille repository
    get fetch origin multipart-merge-prep

    # Do the merge that creates this commit
    git merge origin/multipart-merge-prep --allow-unrelated-histories

This should result in a correct blame and log for `multipart` files.

Original HEAD ref: f4fee608af ("Merge pull request tomaka#134 ...")
Filtered HEAD ref: e0c7c0a ("Merge pull request abonander/multipart#134 ...")
Apply Ondřej's patch from [1] to resolve future compatibility warnings
in multipart, then update it further to resolve FCWs in all default
features (the patch only resolved issues with the features that Rouille
uses).

Co-authored-by: Ondřej Hruška <ondra@ondrovo.com>

[1]: tomaka#271
`buffer-redux` [1] is a maintained fork of `buf-redux` [2]. Switch to it
in `multipart`.

[1]: https://docs.rs/buffer-redux/latest/buffer_redux/
[2]: https://docs.rs/buf_redux/latest/buf_redux/
@bradfier
Copy link
Collaborator

bradfier commented Jun 14, 2025

I'm not sure why, @tgross35, but this PR appears to have the entire tree since the beginning of time in it? The actual change looks like a great solution though so if you can find out what's gone on in Github or Git that would be great. It might be that you need to do a shallow clone from the upstream rather than pulling the whole 510 commits in, if that's possible.

@tgross35
Copy link
Contributor Author

That’s entirely intentional - it’s a rewrite of multipart’s history to a subdirectory then a merge here, so the log and blame and everything for multipart files still shows up correctly in this repo. But if you would prefer, I can change this to a single-commit move :)

tgross35 added 2 commits June 14, 2025 18:13
In preparation for republishing this crate as a version that suit
Rouille's needs, rename it.
@tgross35
Copy link
Contributor Author

@bradfier if you prefer a single commit here, I recreated this but with a squash of multipart's history #296. Feel free to merge one and delete the other!

@bradfier
Copy link
Collaborator

Closed in favour of #296

@bradfier bradfier closed this Jun 17, 2025
@tgross35 tgross35 deleted the vendor-deps branch June 17, 2025 16:05
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.