Skip to content

fix: Make email with spaces round-trip #1922

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

pierrechevalier83
Copy link
Contributor

Before this change, a commit containing "<email@provider.com >" looses the final space when round-tripping, changing the size of the gix-object and it hash.

This was due to the spaces getting trimmed at parse time.

Fix it and show a few examples with tests that now round-trip as expected.

We see this situation in commits in the wild.
Stop trimming the email at parsing time.
We see poorly formatted emails with a space at the end in real Git repos
and we wish for the gitoxide representation for such commits to
roundtrip.

Propagate the fix from `gix-actor` and add a test to show we now
roundtrip.
@Byron Byron force-pushed the make_email_with_spaces_roundtrip branch from 6781235 to ce6c75d Compare April 5, 2025 02:48
Copy link
Member

@Byron Byron left a comment

Choose a reason for hiding this comment

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

Thanks a lot, much appreciated!

Note that I fixed the subject, and decided that the first commit isn't a breaking change as the API doesn't break. Further, I added documentation that makes clear that spaces can be included in the email.

Lastly, I brought back an assertions that was made as part of another fix.

@Byron Byron force-pushed the make_email_with_spaces_roundtrip branch from ce6c75d to 39e35a3 Compare April 5, 2025 02:53
@Byron Byron enabled auto-merge April 5, 2025 02:53
@Byron Byron merged commit c13a403 into GitoxideLabs:main Apr 5, 2025
20 of 21 checks passed
facebook-github-bot pushed a commit to facebook/dotslash that referenced this pull request May 16, 2025
Summary:
ignore-conflict-markers

Upgrade gitoxide crates to latest release to propagate some upstream fixes:
* [[gix-object] Support empty tags with or without trailing NL](GitoxideLabs/gitoxide#1903)
* [[fix] Make Tree roundtrip by storing additional bit of information](GitoxideLabs/gitoxide#1917)
* [fix: Make email with spaces round-trip](GitoxideLabs/gitoxide#1922)
* [Make author and committer date roundtrip](GitoxideLabs/gitoxide#1935)

Reviewed By: quark-zju

Differential Revision: D74337531

fbshipit-source-id: 5361c7d4b0b52c683e05af8d19ac2169aebc8197
facebook-github-bot pushed a commit to facebookincubator/below that referenced this pull request May 16, 2025
Summary:
ignore-conflict-markers

Upgrade gitoxide crates to latest release to propagate some upstream fixes:
* [[gix-object] Support empty tags with or without trailing NL](GitoxideLabs/gitoxide#1903)
* [[fix] Make Tree roundtrip by storing additional bit of information](GitoxideLabs/gitoxide#1917)
* [fix: Make email with spaces round-trip](GitoxideLabs/gitoxide#1922)
* [Make author and committer date roundtrip](GitoxideLabs/gitoxide#1935)

Reviewed By: quark-zju

Differential Revision: D74337531

fbshipit-source-id: 5361c7d4b0b52c683e05af8d19ac2169aebc8197
facebook-github-bot pushed a commit to facebookexperimental/rust-shed that referenced this pull request May 16, 2025
Summary:
ignore-conflict-markers

Upgrade gitoxide crates to latest release to propagate some upstream fixes:
* [[gix-object] Support empty tags with or without trailing NL](GitoxideLabs/gitoxide#1903)
* [[fix] Make Tree roundtrip by storing additional bit of information](GitoxideLabs/gitoxide#1917)
* [fix: Make email with spaces round-trip](GitoxideLabs/gitoxide#1922)
* [Make author and committer date roundtrip](GitoxideLabs/gitoxide#1935)

Reviewed By: quark-zju

Differential Revision: D74337531

fbshipit-source-id: 5361c7d4b0b52c683e05af8d19ac2169aebc8197
facebook-github-bot pushed a commit to facebookexperimental/reverie that referenced this pull request May 16, 2025
Summary:
ignore-conflict-markers

Upgrade gitoxide crates to latest release to propagate some upstream fixes:
* [[gix-object] Support empty tags with or without trailing NL](GitoxideLabs/gitoxide#1903)
* [[fix] Make Tree roundtrip by storing additional bit of information](GitoxideLabs/gitoxide#1917)
* [fix: Make email with spaces round-trip](GitoxideLabs/gitoxide#1922)
* [Make author and committer date roundtrip](GitoxideLabs/gitoxide#1935)

Reviewed By: quark-zju

Differential Revision: D74337531

fbshipit-source-id: 5361c7d4b0b52c683e05af8d19ac2169aebc8197
facebook-github-bot pushed a commit to facebook/sapling that referenced this pull request May 16, 2025
Summary:
ignore-conflict-markers

Upgrade gitoxide crates to latest release to propagate some upstream fixes:
* [[gix-object] Support empty tags with or without trailing NL](GitoxideLabs/gitoxide#1903)
* [[fix] Make Tree roundtrip by storing additional bit of information](GitoxideLabs/gitoxide#1917)
* [fix: Make email with spaces round-trip](GitoxideLabs/gitoxide#1922)
* [Make author and committer date roundtrip](GitoxideLabs/gitoxide#1935)

Reviewed By: quark-zju

Differential Revision: D74337531

fbshipit-source-id: 5361c7d4b0b52c683e05af8d19ac2169aebc8197
facebook-github-bot pushed a commit to facebookincubator/reindeer that referenced this pull request May 16, 2025
Summary:
ignore-conflict-markers

Upgrade gitoxide crates to latest release to propagate some upstream fixes:
* [[gix-object] Support empty tags with or without trailing NL](GitoxideLabs/gitoxide#1903)
* [[fix] Make Tree roundtrip by storing additional bit of information](GitoxideLabs/gitoxide#1917)
* [fix: Make email with spaces round-trip](GitoxideLabs/gitoxide#1922)
* [Make author and committer date roundtrip](GitoxideLabs/gitoxide#1935)

Reviewed By: quark-zju

Differential Revision: D74337531

fbshipit-source-id: 5361c7d4b0b52c683e05af8d19ac2169aebc8197
facebook-github-bot pushed a commit to facebookexperimental/hermit that referenced this pull request May 16, 2025
Summary:
ignore-conflict-markers

Upgrade gitoxide crates to latest release to propagate some upstream fixes:
* [[gix-object] Support empty tags with or without trailing NL](GitoxideLabs/gitoxide#1903)
* [[fix] Make Tree roundtrip by storing additional bit of information](GitoxideLabs/gitoxide#1917)
* [fix: Make email with spaces round-trip](GitoxideLabs/gitoxide#1922)
* [Make author and committer date roundtrip](GitoxideLabs/gitoxide#1935)

Reviewed By: quark-zju

Differential Revision: D74337531

fbshipit-source-id: 5361c7d4b0b52c683e05af8d19ac2169aebc8197
facebook-github-bot pushed a commit to facebook/hhvm that referenced this pull request May 16, 2025
Summary:
ignore-conflict-markers

Upgrade gitoxide crates to latest release to propagate some upstream fixes:
* [[gix-object] Support empty tags with or without trailing NL](GitoxideLabs/gitoxide#1903)
* [[fix] Make Tree roundtrip by storing additional bit of information](GitoxideLabs/gitoxide#1917)
* [fix: Make email with spaces round-trip](GitoxideLabs/gitoxide#1922)
* [Make author and committer date roundtrip](GitoxideLabs/gitoxide#1935)

Reviewed By: quark-zju

Differential Revision: D74337531

fbshipit-source-id: 5361c7d4b0b52c683e05af8d19ac2169aebc8197
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.

2 participants