Skip to content
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

More patcher fixes: they sold us out #1037

Open
xmo-odoo opened this issue Jan 14, 2025 · 0 comments
Open

More patcher fixes: they sold us out #1037

xmo-odoo opened this issue Jan 14, 2025 · 0 comments
Labels

Comments

@xmo-odoo
Copy link
Collaborator

Pretty much from the start I've been relying on the idea that git show was adding a line composed of a single space before and after the commit message.

As it turns out, that never happened, or happens. Instead less does that1 (also delta though that's less of a concern and it does other weird stuff). So I've been relying on a thing which never happened assuming it would make my parser more resilient against user mistakes, and instead it made things more wonky and less reliable.

Footnotes

  1. and even better it apparently only does that when printing to the terminal, if it's piped out of then the content is fine

@github-project-automation github-project-automation bot moved this to ideas in Mergebot Jan 14, 2025
@xmo-odoo xmo-odoo moved this from ideas to done in Mergebot Jan 15, 2025
xmo-odoo added a commit that referenced this issue Jan 15, 2025
Hopefully this is the last fix to the patcher. From the start of the
implementation I relied on the idea that `git show` was adding a line
composed of a single space (and a newline) before and after the patch
message, as that is what I observed in my terminal, and it's
consistent with RFC 3676 signatures (two dashes, a space, and a
newline).

Turns out that single space, while present in my terminal indeed, was
completely made up by `less(1)`. `git show` itself doesn't generate
that, neither does it appear when using most pagers, or even when
piping the output of `less` into something (a file, an other pager,
...). It's pretty much just something `less(1)` sends to a terminal
during interactive sessions to fuck with you.

Fixes #1037
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: done
Development

No branches or pull requests

1 participant