Re: run pgindent on a regular basis / scripted manner
От | Jelte Fennema |
---|---|
Тема | Re: run pgindent on a regular basis / scripted manner |
Дата | |
Msg-id | CAGECzQRH8b6e3W6Mp=mA_81aaUCVoE-4z83HZZV-93EGRubLVQ@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: run pgindent on a regular basis / scripted manner (Maciek Sakrejda <m.sakrejda@gmail.com>) |
Ответы |
Re: run pgindent on a regular basis / scripted manner
|
Список | pgsql-hackers |
On Tue, 17 Oct 2023 at 18:53, Maciek Sakrejda <m.sakrejda@gmail.com> wrote: > Git push does have an --atomic flag to treat the entire push as a single operation. I decided to play around a bit with server hooks. Attached is a git "update" hook that rejects pushes to the master branch when the new HEAD of master does not pass pgindent. It tries to do the minimal amount of work necessary. Together with the --atomic flag of git push I think this would work quite well. Note: It does require that pg_bsd_indent is in PATH. While not perfect seems like it would be acceptable in practice to me. Its version is not updated very frequently. So manually updating it on the git server when we do does not seem like a huge issue to me. The easiest way to try it out is by cloning the postgres repo in two different local directories, let's call them A and B. And then configure directory B to be the origin remote of A. By placing the update script in B/.git/hooks/ it will execute whenever you push master from A to B.
Вложения
В списке pgsql-hackers по дате отправления: