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

pre-process Vim patches with uncrustify / clang-format #6226

Closed
justinmk opened this issue Mar 6, 2017 · 0 comments · Fixed by #20786
Closed

pre-process Vim patches with uncrustify / clang-format #6226

justinmk opened this issue Mar 6, 2017 · 0 comments · Fixed by #20786
Labels
ci automation for build, test, and release compatibility compatibility with Vim or older Neovim enhancement feature request vim-patch See https://neovim.io/doc/user/dev_vimpatch.html
Milestone

Comments

@justinmk
Copy link
Member

justinmk commented Mar 6, 2017

https://github.com/uncrustify/uncrustify could be used to dynamically format Vim sources to make them more compatible with Neovim for patch application.

Strategy:

  • generate the git diff for the vim-patch (or just git log --name-only foo..bar)
  • for each file listed in the git diff,
    1. save the previous version of the file to some temporary location
    2. save the patch version of the file to some temporary location
  • run uncrustify on (1) and (2)
  • generate a diff from the uncrustify'd partial trees
@justinmk justinmk added compatibility compatibility with Vim or older Neovim enhancement feature request tools labels Mar 6, 2017
@justinmk justinmk added this to the todo milestone Mar 6, 2017
@justinmk justinmk changed the title pre-process Vim patches with uncrustify pre-process Vim patches with clang-format Jul 11, 2021
@clason clason added ci automation for build, test, and release and removed tools labels Jul 28, 2021
@clason clason added this to Triage in Automation and CI via automation Sep 25, 2021
@clason clason moved this from Triage to To do in Automation and CI Sep 25, 2021
@justinmk justinmk changed the title pre-process Vim patches with clang-format pre-process Vim patches with uncrustify / clang-format Sep 25, 2021
@justinmk justinmk added the vim-patch See https://neovim.io/doc/user/dev_vimpatch.html label Sep 25, 2021
dundargoc added a commit to dundargoc/neovim that referenced this issue Oct 23, 2022
This will enable a larger amount of chunks being automatically included
due to fewer formatting differences between the vim and neovim files.

The strategy is straightforward, if a bit tedious:

- Get a list of all changed files.
- Checkout parent commit. Copy all relevant files to a temporary
  location.
- Checkout patch commit. Copy all relevant files to a temporary
  location.
- Format .c and .h files with uncrustify.
- Generate a diff from from these files.

Closes neovim#6226
dundargoc added a commit to dundargoc/neovim that referenced this issue Oct 23, 2022
This will enable a larger amount of chunks being automatically included
due to fewer formatting differences between the vim and neovim files.

The strategy is straightforward, if a bit tedious:

- Get a list of all changed files.
- Checkout parent commit. Copy all relevant files to a temporary
  location.
- Checkout patch commit. Copy all relevant files to a temporary
  location.
- Format .c and .h files with uncrustify.
- Generate a diff from from these files.

Closes neovim#6226
dundargoc added a commit to dundargoc/neovim that referenced this issue Oct 24, 2022
This will enable a larger amount of chunks being automatically included
due to fewer formatting differences between the vim and neovim files.

The strategy is straightforward, if a bit tedious:

- Get a list of all changed files.
- Checkout parent commit. Copy all relevant files to a temporary
  location.
- Checkout patch commit. Copy all relevant files to a temporary
  location.
- Format .c and .h files with uncrustify.
- Generate a diff from from these files.

Closes neovim#6226
dundargoc added a commit to dundargoc/neovim that referenced this issue Oct 24, 2022
This will enable a larger amount of chunks being automatically included
due to fewer formatting differences between the vim and neovim files.

The strategy is straightforward, if a bit tedious:

- Get a list of all changed files.
- Checkout parent commit. Copy all relevant files to a temporary
  location.
- Checkout patch commit. Copy all relevant files to a temporary
  location.
- Format .c and .h files with uncrustify.
- Generate a diff from from these files.

Closes neovim#6226
Automation and CI automation moved this from To do to Done Oct 24, 2022
justinmk pushed a commit that referenced this issue Oct 24, 2022
This will enable a larger amount of chunks being automatically included
due to fewer formatting differences between the vim and neovim files.

The strategy is straightforward, if a bit tedious:

- Get a list of all changed files.
- Checkout parent commit. Copy all relevant files to a temporary
  location.
- Checkout patch commit. Copy all relevant files to a temporary
  location.
- Format .c and .h files with uncrustify.
- Generate a diff from from these files.

Closes #6226
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci automation for build, test, and release compatibility compatibility with Vim or older Neovim enhancement feature request vim-patch See https://neovim.io/doc/user/dev_vimpatch.html
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

2 participants