Content-Length: 1348957 | pFad | http://github.com/tonybelloni/postgres/commit/001e114b8d59f4eaf2a314a2bc5e57078afdf82f

2A Fix whitespace issues found by git diff --check, add gitattributes · tonybelloni/postgres@001e114 · GitHub
Skip to content

Commit 001e114

Browse files
committed
Fix whitespace issues found by git diff --check, add gitattributes
Set per file type attributes in .gitattributes to fine-tune whitespace checks. With the associated cleanups, the tree is now clean for git
1 parent dca09ac commit 001e114

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+306
-291
lines changed

.gitattributes

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
* whitespace=space-before-tab,trailing-space
2+
*.[chly] whitespace=space-before-tab,trailing-space,indent-with-non-tab,tabwidth=4
3+
*.dsl whitespace=space-before-tab,trailing-space,tab-in-indent
4+
*.patch -whitespace
5+
*.pl whitespace=space-before-tab,trailing-space,tabwidth=4
6+
*.po whitespace=space-before-tab,trailing-space,tab-in-indent,-blank-at-eof
7+
*.sgml whitespace=space-before-tab,trailing-space,tab-in-indent,-blank-at-eol
8+
*.x[ms]l whitespace=space-before-tab,trailing-space,tab-in-indent
9+
10+
# Avoid confusing ASCII underlines with leftover merge conflict markers
11+
README conflict-marker-size=32
12+
README.* conflict-marker-size=32
13+
14+
# Certain data files that contain special whitespace, and other special cases
15+
**/data/*.data -whitespace
16+
contrib/tsearch2/sql/tsearch2.sql whitespace=space-before-tab,blank-at-eof,-blank-at-eol
17+
doc/bug.template whitespace=space-before-tab,-blank-at-eof,blank-at-eol
18+
src/backend/catalog/sql_features.txt whitespace=space-before-tab,blank-at-eof,-blank-at-eol
19+
src/backend/tsearch/hunspell_sample.affix whitespace=-blank-at-eof
20+
21+
# Test output files that contain extra whitespace
22+
**/expected/*.out -whitespace
23+
**/output/*.source -whitespace
24+
src/interfaces/ecpg/test/expected/* -whitespace
25+
src/interfaces/libpq/test/expected.out whitespace=-blank-at-eof
26+
27+
# These files are maintained or generated elsewhere. We take them as is.
28+
configure -whitespace
29+
ppport.h -whitespace
30+
src/backend/regex/COPYRIGHT -whitespace
31+
src/backend/regex/re_syntax.n -whitespace
32+
src/backend/snowball/libstemmer/*.c -whitespace
33+
src/backend/utils/mb/Unicode/*-std.txt -whitespace
34+
src/include/snowball/libstemmer/* -whitespace

configure.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -919,7 +919,7 @@ fi
919919
if test "$with_gssapi" = yes ; then
920920
if test "$PORTNAME" != "win32"; then
921921
AC_SEARCH_LIBS(gss_init_sec_context, [gssapi_krb5 gss 'gssapi -lkrb5 -lcrypto'], [],
922-
[AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
922+
[AC_MSG_ERROR([could not find function 'gss_init_sec_context' required for GSSAPI])])
923923
else
924924
LIBS="$LIBS -lgssapi32"
925925
fi

contrib/hstore/hstore--1.1--1.2.sql

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
-- A version of 1.1 was shipped with these objects mistakenly in 9.3.0.
8-
-- Therefore we only add them if we detect that they aren't already there and
8+
-- Therefore we only add them if we detect that they aren't already there and
99
-- dependent on the extension.
1010

1111
DO LANGUAGE plpgsql
@@ -26,7 +26,7 @@ BEGIN
2626
AND x.extname = 'hstore';
2727

2828
IF NOT FOUND
29-
THEN
29+
THEN
3030

3131
CREATE FUNCTION hstore_to_json(hstore)
3232
RETURNS json

contrib/hstore/sql/hstore.sql

-1
Original file line numberDiff line numberDiff line change
@@ -341,4 +341,3 @@ insert into test_json_agg values ('rec1','"a key" =>1, b => t, c => null, d=> 12
341341
('rec2','"a key" =>2, b => f, c => "null", d=> -12345, e => 012345.6, f=> -1.234, g=> 0.345e-4');
342342
select json_agg(q) from test_json_agg q;
343343
select json_agg(q) from (select f1, hstore_to_json_loose(f2) as f2 from test_json_agg) q;
344-

contrib/intarray/bench/bench.pl

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
$outf = ($opt{u}) ? 'distinct( message.mid )' : 'message.mid';
8181
}
8282
my $sql =
83-
"select $outf from "
83+
"select $outf from "
8484
. join(', ', keys %table)
8585
. " where "
8686
. join(' AND ', @where) . ';';

contrib/pgbench/pgbench.c

+8-10
Original file line numberDiff line numberDiff line change
@@ -368,17 +368,15 @@ usage(void)
368368
" -j, --jobs=NUM number of threads (default: 1)\n"
369369
" -l, --log write transaction times to log file\n"
370370
" -M, --protocol=simple|extended|prepared\n"
371-
" protocol for submitting queries "
372-
"(default: simple)\n"
371+
" protocol for submitting queries (default: simple)\n"
373372
" -n, --no-vacuum do not run VACUUM before tests\n"
374373
" -N, --skip-some-updates skip updates of pgbench_tellers and pgbench_branches\n"
375374
" -P, --progress=NUM show thread progress report every NUM seconds\n"
376375
" -r, --report-latencies report average latency per command\n"
377376
" -R, --rate=NUM target rate in transactions per second\n"
378377
" -s, --scale=NUM report this scale factor in output\n"
379378
" -S, --select-only perform SELECT-only transactions\n"
380-
" -t, --transactions number of transactions each client runs "
381-
"(default: 10)\n"
379+
" -t, --transactions number of transactions each client runs (default: 10)\n"
382380
" -T, --time=NUM duration of benchmark test in seconds\n"
383381
" -v, --vacuum-all vacuum all four standard tables before tests\n"
384382
" --aggregate-interval=NUM aggregate data over NUM seconds\n"
@@ -933,7 +931,7 @@ doCustom(TState *thread, CState *st, instr_time *conn_time, FILE *logfile, AggVa
933931
* Use inverse transform sampling to randomly generate a delay, such
934932
* that the series of delays will approximate a Poisson distribution
935933
* centered on the throttle_delay time.
936-
*
934+
*
937935
* 10000 implies a 9.2 (-log(1/10000)) to 0.0 (log 1) delay multiplier,
938936
* and results in a 0.055 % target underestimation bias:
939937
*
@@ -1211,9 +1209,9 @@ doCustom(TState *thread, CState *st, instr_time *conn_time, FILE *logfile, AggVa
12111209
}
12121210

12131211
/*
1214-
* This ensures that a throttling delay is inserted before proceeding
1215-
* with sql commands, after the first transaction. The first transaction
1216-
* throttling is performed when first entering doCustom.
1212+
* This ensures that a throttling delay is inserted before proceeding
1213+
* with sql commands, after the first transaction. The first transaction
1214+
* throttling is performed when first entering doCustom.
12171215
*/
12181216
if (trans_needs_throttle) {
12191217
trans_needs_throttle = false;
@@ -2180,7 +2178,7 @@ printResults(int ttype, int normal_xacts, int nclients,
21802178
latency, 0.001 * sqrt(sqlat - 1000000.0 * latency * latency));
21812179
}
21822180
else
2183-
{
2181+
{
21842182
/* only an average latency computed from the duration is available */
21852183
printf("latency average: %.3f ms\n",
21862184
1000.0 * duration * nclients / normal_xacts);
@@ -2569,7 +2567,7 @@ main(int argc, char **argv)
25692567
}
25702568
}
25712569

2572-
/* compute a per thread delay */
2570+
/* compute a per thread delay */
25732571
throttle_delay *= nthreads;
25742572

25752573
if (argc > optind)

contrib/pgcrypto/expected/pgp-encrypt.out

+18-18
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ select pgp_sym_decrypt(pgp_sym_encrypt('Secret.', 'key'), 'key');
1111

1212
-- check whether the defaults are ok
1313
select pgp_sym_decrypt(pgp_sym_encrypt('Secret.', 'key'),
14-
'key', 'expect-cipher-algo=aes128,
14+
'key', 'expect-cipher-algo=aes128,
1515
expect-disable-mdc=0,
1616
expect-sess-key=0,
1717
expect-s2k-mode=3,
@@ -25,7 +25,7 @@ select pgp_sym_decrypt(pgp_sym_encrypt('Secret.', 'key'),
2525

2626
-- maybe the expect- stuff simply does not work
2727
select pgp_sym_decrypt(pgp_sym_encrypt('Secret.', 'key'),
28-
'key', 'expect-cipher-algo=bf,
28+
'key', 'expect-cipher-algo=bf,
2929
expect-disable-mdc=1,
3030
expect-sess-key=1,
3131
expect-s2k-mode=0,
@@ -56,23 +56,23 @@ select pgp_sym_decrypt_bytea(pgp_sym_encrypt('Text', 'baz'), 'baz');
5656
-- algorithm change
5757
select pgp_sym_decrypt(
5858
pgp_sym_encrypt('Secret.', 'key', 'cipher-algo=bf'),
59-
'key', 'expect-cipher-algo=bf');
59+
'key', 'expect-cipher-algo=bf');
6060
pgp_sym_decrypt
6161
-----------------
6262
Secret.
6363
(1 row)
6464

6565
select pgp_sym_decrypt(
6666
pgp_sym_encrypt('Secret.', 'key', 'cipher-algo=aes'),
67-
'key', 'expect-cipher-algo=aes128');
67+
'key', 'expect-cipher-algo=aes128');
6868
pgp_sym_decrypt
6969
-----------------
7070
Secret.
7171
(1 row)
7272

7373
select pgp_sym_decrypt(
7474
pgp_sym_encrypt('Secret.', 'key', 'cipher-algo=aes192'),
75-
'key', 'expect-cipher-algo=aes192');
75+
'key', 'expect-cipher-algo=aes192');
7676
pgp_sym_decrypt
7777
-----------------
7878
Secret.
@@ -81,23 +81,23 @@ select pgp_sym_decrypt(
8181
-- s2k change
8282
select pgp_sym_decrypt(
8383
pgp_sym_encrypt('Secret.', 'key', 's2k-mode=0'),
84-
'key', 'expect-s2k-mode=0');
84+
'key', 'expect-s2k-mode=0');
8585
pgp_sym_decrypt
8686
-----------------
8787
Secret.
8888
(1 row)
8989

9090
select pgp_sym_decrypt(
9191
pgp_sym_encrypt('Secret.', 'key', 's2k-mode=1'),
92-
'key', 'expect-s2k-mode=1');
92+
'key', 'expect-s2k-mode=1');
9393
pgp_sym_decrypt
9494
-----------------
9595
Secret.
9696
(1 row)
9797

9898
select pgp_sym_decrypt(
9999
pgp_sym_encrypt('Secret.', 'key', 's2k-mode=3'),
100-
'key', 'expect-s2k-mode=3');
100+
'key', 'expect-s2k-mode=3');
101101
pgp_sym_decrypt
102102
-----------------
103103
Secret.
@@ -106,15 +106,15 @@ select pgp_sym_decrypt(
106106
-- s2k digest change
107107
select pgp_sym_decrypt(
108108
pgp_sym_encrypt('Secret.', 'key', 's2k-digest-algo=md5'),
109-
'key', 'expect-s2k-digest-algo=md5');
109+
'key', 'expect-s2k-digest-algo=md5');
110110
pgp_sym_decrypt
111111
-----------------
112112
Secret.
113113
(1 row)
114114

115115
select pgp_sym_decrypt(
116116
pgp_sym_encrypt('Secret.', 'key', 's2k-digest-algo=sha1'),
117-
'key', 'expect-s2k-digest-algo=sha1');
117+
'key', 'expect-s2k-digest-algo=sha1');
118118
pgp_sym_decrypt
119119
-----------------
120120
Secret.
@@ -123,39 +123,39 @@ select pgp_sym_decrypt(
123123
-- sess key
124124
select pgp_sym_decrypt(
125125
pgp_sym_encrypt('Secret.', 'key', 'sess-key=0'),
126-
'key', 'expect-sess-key=0');
126+
'key', 'expect-sess-key=0');
127127
pgp_sym_decrypt
128128
-----------------
129129
Secret.
130130
(1 row)
131131

132132
select pgp_sym_decrypt(
133133
pgp_sym_encrypt('Secret.', 'key', 'sess-key=1'),
134-
'key', 'expect-sess-key=1');
134+
'key', 'expect-sess-key=1');
135135
pgp_sym_decrypt
136136
-----------------
137137
Secret.
138138
(1 row)
139139

140140
select pgp_sym_decrypt(
141141
pgp_sym_encrypt('Secret.', 'key', 'sess-key=1, cipher-algo=bf'),
142-
'key', 'expect-sess-key=1, expect-cipher-algo=bf');
142+
'key', 'expect-sess-key=1, expect-cipher-algo=bf');
143143
pgp_sym_decrypt
144144
-----------------
145145
Secret.
146146
(1 row)
147147

148148
select pgp_sym_decrypt(
149149
pgp_sym_encrypt('Secret.', 'key', 'sess-key=1, cipher-algo=aes192'),
150-
'key', 'expect-sess-key=1, expect-cipher-algo=aes192');
150+
'key', 'expect-sess-key=1, expect-cipher-algo=aes192');
151151
pgp_sym_decrypt
152152
-----------------
153153
Secret.
154154
(1 row)
155155

156156
select pgp_sym_decrypt(
157157
pgp_sym_encrypt('Secret.', 'key', 'sess-key=1, cipher-algo=aes256'),
158-
'key', 'expect-sess-key=1, expect-cipher-algo=aes256');
158+
'key', 'expect-sess-key=1, expect-cipher-algo=aes256');
159159
pgp_sym_decrypt
160160
-----------------
161161
Secret.
@@ -164,7 +164,7 @@ select pgp_sym_decrypt(
164164
-- no mdc
165165
select pgp_sym_decrypt(
166166
pgp_sym_encrypt('Secret.', 'key', 'disable-mdc=1'),
167-
'key', 'expect-disable-mdc=1');
167+
'key', 'expect-disable-mdc=1');
168168
pgp_sym_decrypt
169169
-----------------
170170
Secret.
@@ -173,7 +173,7 @@ select pgp_sym_decrypt(
173173
-- crlf
174174
select encode(pgp_sym_decrypt_bytea(
175175
pgp_sym_encrypt(E'1\n2\n3\r\n', 'key', 'convert-crlf=1'),
176-
'key'), 'hex');
176+
'key'), 'hex');
177177
encode
178178
----------------------
179179
310d0a320d0a330d0d0a
@@ -182,7 +182,7 @@ select encode(pgp_sym_decrypt_bytea(
182182
-- conversion should be lossless
183183
select encode(digest(pgp_sym_decrypt(
184184
pgp_sym_encrypt(E'\r\n0\n1\r\r\n\n2\r', 'key', 'convert-crlf=1'),
185-
'key', 'convert-crlf=1'), 'sha1'), 'hex') as result,
185+
'key', 'convert-crlf=1'), 'sha1'), 'hex') as result,
186186
encode(digest(E'\r\n0\n1\r\r\n\n2\r', 'sha1'), 'hex') as expect;
187187
result | expect
188188
------------------------------------------+------------------------------------------

contrib/pgcrypto/sql/pgp-encrypt.sql

+18-18
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ select pgp_sym_decrypt(pgp_sym_encrypt('Secret.', 'key'), 'key');
88

99
-- check whether the defaults are ok
1010
select pgp_sym_decrypt(pgp_sym_encrypt('Secret.', 'key'),
11-
'key', 'expect-cipher-algo=aes128,
11+
'key', 'expect-cipher-algo=aes128,
1212
expect-disable-mdc=0,
1313
expect-sess-key=0,
1414
expect-s2k-mode=3,
@@ -18,7 +18,7 @@ select pgp_sym_decrypt(pgp_sym_encrypt('Secret.', 'key'),
1818

1919
-- maybe the expect- stuff simply does not work
2020
select pgp_sym_decrypt(pgp_sym_encrypt('Secret.', 'key'),
21-
'key', 'expect-cipher-algo=bf,
21+
'key', 'expect-cipher-algo=bf,
2222
expect-disable-mdc=1,
2323
expect-sess-key=1,
2424
expect-s2k-mode=0,
@@ -36,62 +36,62 @@ select pgp_sym_decrypt_bytea(pgp_sym_encrypt('Text', 'baz'), 'baz');
3636
-- algorithm change
3737
select pgp_sym_decrypt(
3838
pgp_sym_encrypt('Secret.', 'key', 'cipher-algo=bf'),
39-
'key', 'expect-cipher-algo=bf');
39+
'key', 'expect-cipher-algo=bf');
4040
select pgp_sym_decrypt(
4141
pgp_sym_encrypt('Secret.', 'key', 'cipher-algo=aes'),
42-
'key', 'expect-cipher-algo=aes128');
42+
'key', 'expect-cipher-algo=aes128');
4343
select pgp_sym_decrypt(
4444
pgp_sym_encrypt('Secret.', 'key', 'cipher-algo=aes192'),
45-
'key', 'expect-cipher-algo=aes192');
45+
'key', 'expect-cipher-algo=aes192');
4646

4747
-- s2k change
4848
select pgp_sym_decrypt(
4949
pgp_sym_encrypt('Secret.', 'key', 's2k-mode=0'),
50-
'key', 'expect-s2k-mode=0');
50+
'key', 'expect-s2k-mode=0');
5151
select pgp_sym_decrypt(
5252
pgp_sym_encrypt('Secret.', 'key', 's2k-mode=1'),
53-
'key', 'expect-s2k-mode=1');
53+
'key', 'expect-s2k-mode=1');
5454
select pgp_sym_decrypt(
5555
pgp_sym_encrypt('Secret.', 'key', 's2k-mode=3'),
56-
'key', 'expect-s2k-mode=3');
56+
'key', 'expect-s2k-mode=3');
5757

5858
-- s2k digest change
5959
select pgp_sym_decrypt(
6060
pgp_sym_encrypt('Secret.', 'key', 's2k-digest-algo=md5'),
61-
'key', 'expect-s2k-digest-algo=md5');
61+
'key', 'expect-s2k-digest-algo=md5');
6262
select pgp_sym_decrypt(
6363
pgp_sym_encrypt('Secret.', 'key', 's2k-digest-algo=sha1'),
64-
'key', 'expect-s2k-digest-algo=sha1');
64+
'key', 'expect-s2k-digest-algo=sha1');
6565

6666
-- sess key
6767
select pgp_sym_decrypt(
6868
pgp_sym_encrypt('Secret.', 'key', 'sess-key=0'),
69-
'key', 'expect-sess-key=0');
69+
'key', 'expect-sess-key=0');
7070
select pgp_sym_decrypt(
7171
pgp_sym_encrypt('Secret.', 'key', 'sess-key=1'),
72-
'key', 'expect-sess-key=1');
72+
'key', 'expect-sess-key=1');
7373
select pgp_sym_decrypt(
7474
pgp_sym_encrypt('Secret.', 'key', 'sess-key=1, cipher-algo=bf'),
75-
'key', 'expect-sess-key=1, expect-cipher-algo=bf');
75+
'key', 'expect-sess-key=1, expect-cipher-algo=bf');
7676
select pgp_sym_decrypt(
7777
pgp_sym_encrypt('Secret.', 'key', 'sess-key=1, cipher-algo=aes192'),
78-
'key', 'expect-sess-key=1, expect-cipher-algo=aes192');
78+
'key', 'expect-sess-key=1, expect-cipher-algo=aes192');
7979
select pgp_sym_decrypt(
8080
pgp_sym_encrypt('Secret.', 'key', 'sess-key=1, cipher-algo=aes256'),
81-
'key', 'expect-sess-key=1, expect-cipher-algo=aes256');
81+
'key', 'expect-sess-key=1, expect-cipher-algo=aes256');
8282

8383
-- no mdc
8484
select pgp_sym_decrypt(
8585
pgp_sym_encrypt('Secret.', 'key', 'disable-mdc=1'),
86-
'key', 'expect-disable-mdc=1');
86+
'key', 'expect-disable-mdc=1');
8787

8888
-- crlf
8989
select encode(pgp_sym_decrypt_bytea(
9090
pgp_sym_encrypt(E'1\n2\n3\r\n', 'key', 'convert-crlf=1'),
91-
'key'), 'hex');
91+
'key'), 'hex');
9292

9393
-- conversion should be lossless
9494
select encode(digest(pgp_sym_decrypt(
9595
pgp_sym_encrypt(E'\r\n0\n1\r\r\n\n2\r', 'key', 'convert-crlf=1'),
96-
'key', 'convert-crlf=1'), 'sha1'), 'hex') as result,
96+
'key', 'convert-crlf=1'), 'sha1'), 'hex') as result,
9797
encode(digest(E'\r\n0\n1\r\r\n\n2\r', 'sha1'), 'hex') as expect;

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/tonybelloni/postgres/commit/001e114b8d59f4eaf2a314a2bc5e57078afdf82f

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy