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

build(vim-patch.sh): include commit subject #28767

Merged
merged 1 commit into from
May 21, 2024

Conversation

wookayin
Copy link
Member

@wookayin wookayin commented May 16, 2024

Problem: vim-patch commits lack an informative title and summary in the
very first line of the commit message when the vim-revision is a Git SHA
hash, unlike when is a Vim version. This makes it difficult to discern
at a glance what changes are introduced by such vim-patch commits (in
git log, PR title, changelog generated by git-cliff, etc.).

e.g. Before:

vim-patch:abcdef123456

runtime(vim): improve performance

<some details>
...

Solution: Repeat the title of the upstream commit message, to improve
the clarity and visibility of the commit message.

e.g. After:

vim-patch:abcdef123456: runtime(vim): improve performance

<some details>
...

Note: the vim-patch:<hash> token is still needed by vim-patch.sh
(but not necessarily in the very first line of the commit message) to
determine which vim patches have been applied.

@wookayin wookayin marked this pull request as draft May 16, 2024 03:01
@github-actions github-actions bot added the build building and installing Neovim using the provided scripts label May 16, 2024
@wookayin wookayin added project-management Neovim project matters (release process, logo, etc.) needs:discussion For PRs that propose significant changes to some part of the architecture or API labels May 16, 2024
@wookayin
Copy link
Member Author

wookayin commented May 16, 2024

We could possibly consider the 'new' commit message style starting from 11.0-dev cycle, if I may propose this. Though we might discuss first to have a consensus on which format would be the best for devs.

Since the prefix might be a bit too lengthy, we could also consider some other alternatives like:

  1. More abbreviated SHA hash: e.g. vim-patch:abcdef01: runtime(vim): improve performance
  • con: we might want lengthy enough SHA hashes (8+ or 12 chars), normalization might be an issue
  1. Or do not include the SHA in the first-line title: e.g. vim-patch: runtime(vim): improve performance
  • Since the SHA hash itself is not very useful for human other than the internal purposes for vim-patch.sh
  • Note: Tokens like vim-patch:abcdef012345 are still needed in the commit message body.

@wookayin wookayin requested review from clason and zeertzjq May 16, 2024 03:10
@zeertzjq
Copy link
Member

Actually the token only needs to have 7 hex digits:

  # Use sed…{7,7} to normalize (internal) Git hashes (for tokens caches).
  git -C "${NVIM_SOURCE_DIR}" log -E --grep='vim-patch:[^ ,{]{7,}' \
    | grep -oE 'vim-patch:[^ ,{:]{7,}' \
    | sort \
    | uniq \
    | sed -nEe 's/^(vim-patch:([0-9]+\.[^ ]+|[0-9a-z]{7,7})).*/\1/p'
    # Check for vim-patch:<commit_hash> (usually runtime updates).
    token="vim-patch:${line:0:7}"
    if [[ "${tokens[$token]-}" ]]; then
      continue
    fi

Problem: vim-patch commits lack an informative title and summary in the
very first line of the commit message when the vim-revision is a Git SHA
hash, unlike when is a Vim version. This makes it difficult to discern
at a glance what changes are introduced by such vim-patch commits (in
git log, PR title, changelog generated by git-cliff, etc.).

e.g. Before:

    vim-patch:abcdef123456

    runtime(vim): improve performance

    <some details>
    ...

Solution: Repeat the title of the upstream commit message, to improve
the clarity and visibility of the commit message.

e.g. After:

    vim-patch:abcdef123456: runtime(vim): improve performance

    <some details>
    ...

Note: the `vim-patch:<hash>` token is still needed by `vim-patch.sh`
(but not necessarily in the very first line of the commit message) to
determine which vim patches have been applied. `<hash>` is internally
normalized to 7 hex digits.
@wookayin
Copy link
Member Author

wookayin commented May 18, 2024

For this PR I've drafted with not changing the number of hex digits, but I will leave to other core dev's decision whether to use 12 hex digits (current, since 03a0417), 7 digits, or other number of digits (say 8) --- if we think the title can be too length. I personally think being a bit lengthy for vim-patches is fine.

@wookayin wookayin marked this pull request as ready for review May 18, 2024 01:08
@justinmk justinmk merged commit 7aaa4a5 into neovim:master May 21, 2024
31 checks passed
@justinmk
Copy link
Member

will leave to other core dev's decision whether to use 12 hex digits (current, since 03a0417), 7 digits, or other

I generally recommend 12 digits, but for vim-patch it's low risk.

@wookayin wookayin changed the title build(vim-patch.sh): always include commit message title build(vim-patch.sh): include commit subject May 21, 2024
@wookayin wookayin deleted the vim-patch-msgtitle branch May 21, 2024 17:08
@zeertzjq zeertzjq removed the needs:discussion For PRs that propose significant changes to some part of the architecture or API label May 21, 2024
huangyingw pushed a commit to huangyingw/neovim that referenced this pull request May 31, 2024
Problem: vim-patch commits lack an informative title and summary in the
very first line of the commit message when the vim-revision is a Git SHA
hash, unlike when is a Vim version. This makes it difficult to discern
at a glance what changes are introduced by such vim-patch commits (in
git log, PR title, changelog generated by git-cliff, etc.).

BEFORE:

    vim-patch:abcdef123456

    runtime(vim): improve performance

    <some details>
    ...

Solution: Repeat the title of the upstream commit message, to improve
the clarity and visibility of the commit message.

AFTER:

    vim-patch:abcdef123456: runtime(vim): improve performance

    <some details>
    ...

Note: the `vim-patch:<hash>` token is still needed by `vim-patch.sh`
(but not necessarily in the very first line of the commit message) to
determine which vim patches have been applied. `<hash>` is internally
normalized to 7 hex digits.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build building and installing Neovim using the provided scripts project-management Neovim project matters (release process, logo, etc.)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants