Three commit tips

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Three commit tips
Date: 2023-11-02 15:22:38
Message-ID: ZUO-vjLa-Bb4a2VD@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I have three suggestions on committing that I thought would be helpful
to the hacker audience.

First, I have been hesitant to ascribe others as patch authors if I
heavily modified a doc patch because I didn't want them blamed for any
mistakes I made. However, I also want to give them credit, so I decided
I would annotate commits with "partial", e.g.:

Author: Andy Jackson (partial)

Second, I have found the git diff option --word-diff=color to be very
helpful and I have started using it, especially for doc patches where
the old text is in red and the new text is in green. Posting patches in
that format is probably not helpful though.

Third, I have come up with the following shell script to test for proper
pgindentation, which I run automatically before commit:

# https://www.postgresql.org/message-id/CAGECzQQL-Dbb%2BYkid9Dhq-491MawHvi6hR_NGkhiDE%2B5zRZ6vQ%40mail.gmail.com
src/tools/pgindent/pgindent $(git diff --name-only --diff-filter=ACMR) > /tmp/$$

if [ \( "$(wc -l < /tmp/$$)" -eq 1 -a "$(expr match "$(cat /tmp/$$)" "No files to process\>")" -eq 0 \) -o \
"$(wc -l < /tmp/$$)" -gt 1 ]
then echo "pgindent failure in master branch, exiting." 1>&2
cat /tmp/$$
exit 1
fi

--
Bruce Momjian <bruce(at)momjian(dot)us> https://momjian.us
EDB https://enterprisedb.com

Only you can decide what is important to you.

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2023-11-02 15:30:10 Re: logical decoding and replication of sequences, take 2
Previous Message Japin Li 2023-11-02 14:42:13 Re: Tab completion regression test failed on illumos