diff options
author | figsoda <figsoda@pm.me> | 2023-01-01 15:47:21 -0500 |
---|---|---|
committer | figsoda <figsoda@pm.me> | 2023-01-01 15:48:42 -0500 |
commit | 8ef668d7f4e0577b638668e3edf2fc0dd77fff1d (patch) | |
tree | 8f1ed38de283e83a99c6c5d316adfb466173f6b0 | |
parent | af62c860ec78e9c211f97ae6c48f7efb306402f0 (diff) | |
download | nixpkgs-8ef668d7f4e0577b638668e3edf2fc0dd77fff1d.tar nixpkgs-8ef668d7f4e0577b638668e3edf2fc0dd77fff1d.tar.gz nixpkgs-8ef668d7f4e0577b638668e3edf2fc0dd77fff1d.tar.bz2 nixpkgs-8ef668d7f4e0577b638668e3edf2fc0dd77fff1d.tar.lz nixpkgs-8ef668d7f4e0577b638668e3edf2fc0dd77fff1d.tar.xz nixpkgs-8ef668d7f4e0577b638668e3edf2fc0dd77fff1d.tar.zst nixpkgs-8ef668d7f4e0577b638668e3edf2fc0dd77fff1d.zip |
vimPlugins: only commit nvim-treesitter updates when there are actually updates
-rwxr-xr-x | pkgs/applications/editors/vim/plugins/update.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/pkgs/applications/editors/vim/plugins/update.py b/pkgs/applications/editors/vim/plugins/update.py index 7e5c7380597..20336c66ed6 100755 --- a/pkgs/applications/editors/vim/plugins/update.py +++ b/pkgs/applications/editors/vim/plugins/update.py @@ -137,11 +137,15 @@ def main(): subprocess.check_call([nvim_treesitter_dir.joinpath("update.py")]) if editor.nixpkgs_repo: - msg = "vimPlugins.nvim-treesitter: update grammars" - print(f"committing to nixpkgs: {msg}") index = editor.nixpkgs_repo.index - index.add([str(nvim_treesitter_dir.joinpath("generated.nix"))]) - index.commit(msg) + for diff in index.diff(None): + if diff.a_path == "pkgs/applications/editors/vim/plugins/nvim-treesitter/generated.nix": + msg = "vimPlugins.nvim-treesitter: update grammars" + print(f"committing to nixpkgs: {msg}") + index.add([str(nvim_treesitter_dir.joinpath("generated.nix"))]) + index.commit(msg) + return + print("no updates to nvim-treesitter grammars") if __name__ == "__main__": |