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

Docs: Handle long commit messages in [skip ci] example #11601

Merged
merged 1 commit into from
Sep 17, 2024

Conversation

dbaston
Copy link
Contributor

@dbaston dbaston commented Sep 14, 2024

git log will wrap longer commit messages onto multiple lines, in which case a commit with [skip ci] will not cause a build to skip.


📚 Documentation previews 📚

@dbaston dbaston requested a review from a team as a code owner September 14, 2024 22:17
Copy link
Member

@humitos humitos left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. Can you post some examples? I'm not being able to make it work with a multi-line commit.

@dbaston
Copy link
Contributor Author

dbaston commented Sep 16, 2024

git commit -m "a single line message"
(git --no-pager log --pretty="tformat:%s -- %b" -1 | paste -s -d ' ' | grep -viq "skip ci") || echo "EXIT"
# no output
git commit -m "a single line message [skip ci]"
(git --no-pager log --pretty="tformat:%s -- %b" -1 | paste -s -d ' ' | grep -viq "skip ci") || echo "EXIT"
# EXIT
git commit -m "a double line message" -m "[skip ci]"
(git --no-pager log --pretty="tformat:%s -- %b" -1 | paste -s -d ' ' | grep -viq "skip ci") || echo "EXIT"
# EXIT
git commit -m "a double line message" -m "a really long second line $(ps aux) [skip ci]"
(git --no-pager log --pretty="tformat:%s -- %b" -1 | paste -s -d ' ' | grep -viq "skip ci") || echo "EXIT"
# EXIT

@humitos humitos self-requested a review September 16, 2024 12:56
@humitos humitos enabled auto-merge (squash) September 16, 2024 12:57
@ericholscher ericholscher merged commit c5004d3 into readthedocs:main Sep 17, 2024
3 checks passed
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