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

fix: stabilize formatting of autogenerated commits #32

Merged
merged 1 commit into from
Feb 5, 2020

Conversation

wincent
Copy link
Contributor

@wincent wincent commented Feb 5, 2020

The git log command we were using here is sensitive to user-local configuration (see the "log.decorate" option in man git-config, for example), which means that one user running the update might produce a commit message like:

Update ckeditor-dev to e1836357e (HEAD, tag: 4.11.4, origin/release/4.11.x) SCAYT/WSC changelog corrected.

and another might produce:

Update ckeditor-dev to e1836357e (tag: 4.11.4) SCAYT/WSC changelog corrected.

Make it totally stable by explicitly providing a format string, which will make the messages look this this:

Update ckeditor-dev to 4.11.4

e1836357e (tag: 4.11.4) SCAYT/WSC changelog corrected.

The other small improvement here is avoiding the unnecessary fork of a separate "head" process by passing "-1" to git log with equivalent effect.

Test plan: Run ./ck.sh update and see that it makes a commit like this:

commit 92c6594d08a30c242de1f239d73477ebf4964ef9
Author: Greg Hurrell <[email protected]>
Date:   Wed Feb 5 09:37:29 2020 +0100

    Update ckeditor-dev to 4.13.1

    411985373 (tag: 4.13.1) Updated language files.

@wincent wincent added the bug label Feb 5, 2020
@wincent wincent requested a review from julien February 5, 2020 08:40
The `git log` command we were using here is sensitive to user-local
configuration (see the "log.decorate" option in `man git-config`, for
example), which means that one user running the update might produce a
commit message like:

    Update ckeditor-dev to e1836357e (HEAD, tag: 4.11.4, origin/release/4.11.x) SCAYT/WSC changelog corrected.

and another might produce:

    Update ckeditor-dev to e1836357e (tag: 4.11.4) SCAYT/WSC changelog corrected.

Make it totally stable by explicitly providing a format string, which
will make the messages look this this:

    Update ckeditor-dev to 4.11.4

    e1836357e (tag: 4.11.4) SCAYT/WSC changelog corrected.

The other small improvement here is avoiding the unnecessary fork of a
separate "head" process by passing "-1" to `git log` with equivalent
effect.

Test plan: Run `./ck.sh update` and see that it makes a commit like
this:

    commit 92c6594d08a30c242de1f239d73477ebf4964ef9
    Author: Greg Hurrell <[email protected]>
    Date:   Wed Feb 5 09:37:29 2020 +0100

        Update ckeditor-dev to 4.13.1

        411985373 (tag: 4.13.1) Updated language files.
@julien julien merged commit 9bf3e69 into master Feb 5, 2020
@julien
Copy link
Contributor

julien commented Feb 5, 2020

Thanks @wincent

@wincent wincent deleted the wincent/no-decorate branch February 5, 2020 09:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants