1
0
mirror of https://github.com/postgres/postgres.git synced 2025-04-20 00:42:27 +03:00

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
This commit is contained in:
Peter Eisentraut 2013-11-10 09:20:52 -05:00
parent dca09ac533
commit 001e114b8d
78 changed files with 303 additions and 288 deletions

34
.gitattributes vendored Normal file
View File

@ -0,0 +1,34 @@
* whitespace=space-before-tab,trailing-space
*.[chly] whitespace=space-before-tab,trailing-space,indent-with-non-tab,tabwidth=4
*.dsl whitespace=space-before-tab,trailing-space,tab-in-indent
*.patch -whitespace
*.pl whitespace=space-before-tab,trailing-space,tabwidth=4
*.po whitespace=space-before-tab,trailing-space,tab-in-indent,-blank-at-eof
*.sgml whitespace=space-before-tab,trailing-space,tab-in-indent,-blank-at-eol
*.x[ms]l whitespace=space-before-tab,trailing-space,tab-in-indent
# Avoid confusing ASCII underlines with leftover merge conflict markers
README conflict-marker-size=32
README.* conflict-marker-size=32
# Certain data files that contain special whitespace, and other special cases
**/data/*.data -whitespace
contrib/tsearch2/sql/tsearch2.sql whitespace=space-before-tab,blank-at-eof,-blank-at-eol
doc/bug.template whitespace=space-before-tab,-blank-at-eof,blank-at-eol
src/backend/catalog/sql_features.txt whitespace=space-before-tab,blank-at-eof,-blank-at-eol
src/backend/tsearch/hunspell_sample.affix whitespace=-blank-at-eof
# Test output files that contain extra whitespace
**/expected/*.out -whitespace
**/output/*.source -whitespace
src/interfaces/ecpg/test/expected/* -whitespace
src/interfaces/libpq/test/expected.out whitespace=-blank-at-eof
# These files are maintained or generated elsewhere. We take them as is.
configure -whitespace
ppport.h -whitespace
src/backend/regex/COPYRIGHT -whitespace
src/backend/regex/re_syntax.n -whitespace
src/backend/snowball/libstemmer/*.c -whitespace
src/backend/utils/mb/Unicode/*-std.txt -whitespace
src/include/snowball/libstemmer/* -whitespace

View File

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

View File

@ -368,8 +368,7 @@ usage(void)
" -j, --jobs=NUM number of threads (default: 1)\n" " -j, --jobs=NUM number of threads (default: 1)\n"
" -l, --log write transaction times to log file\n" " -l, --log write transaction times to log file\n"
" -M, --protocol=simple|extended|prepared\n" " -M, --protocol=simple|extended|prepared\n"
" protocol for submitting queries " " protocol for submitting queries (default: simple)\n"
"(default: simple)\n"
" -n, --no-vacuum do not run VACUUM before tests\n" " -n, --no-vacuum do not run VACUUM before tests\n"
" -N, --skip-some-updates skip updates of pgbench_tellers and pgbench_branches\n" " -N, --skip-some-updates skip updates of pgbench_tellers and pgbench_branches\n"
" -P, --progress=NUM show thread progress report every NUM seconds\n" " -P, --progress=NUM show thread progress report every NUM seconds\n"
@ -377,8 +376,7 @@ usage(void)
" -R, --rate=NUM target rate in transactions per second\n" " -R, --rate=NUM target rate in transactions per second\n"
" -s, --scale=NUM report this scale factor in output\n" " -s, --scale=NUM report this scale factor in output\n"
" -S, --select-only perform SELECT-only transactions\n" " -S, --select-only perform SELECT-only transactions\n"
" -t, --transactions number of transactions each client runs " " -t, --transactions number of transactions each client runs (default: 10)\n"
"(default: 10)\n"
" -T, --time=NUM duration of benchmark test in seconds\n" " -T, --time=NUM duration of benchmark test in seconds\n"
" -v, --vacuum-all vacuum all four standard tables before tests\n" " -v, --vacuum-all vacuum all four standard tables before tests\n"
" --aggregate-interval=NUM aggregate data over NUM seconds\n" " --aggregate-interval=NUM aggregate data over NUM seconds\n"

View File

@ -561,4 +561,3 @@ makeFuncCall(List *name, List *args, int location)
n->over = NULL; n->over = NULL;
return n; return n;
} }

View File

@ -2143,7 +2143,6 @@ process_log_prefix_padding(const char *p, int *ppadding)
paddingsign = -1; paddingsign = -1;
} }
/* generate an int version of the numerical string */ /* generate an int version of the numerical string */
while (*p >= '0' && *p <= '9') while (*p >= '0' && *p <= '9')
padding = padding * 10 + (*p++ - '0'); padding = padding * 10 + (*p++ - '0');
@ -2371,7 +2370,6 @@ log_line_prefix(StringInfo buf, ErrorData *edata)
} }
else else
appendStringInfo(buf, "%*s", padding, MyProcPort->remote_host); appendStringInfo(buf, "%*s", padding, MyProcPort->remote_host);
} }
else else
{ {

View File

@ -1041,20 +1041,21 @@ exec_command(const char *cmd,
if (!opt0) if (!opt0)
{ {
size_t i;
/* list all variables */ /* list all variables */
int i;
static const char *const my_list[] = { static const char *const my_list[] = {
"border", "columns", "expanded", "fieldsep", "border", "columns", "expanded", "fieldsep",
"footer", "format", "linestyle", "null", "footer", "format", "linestyle", "null",
"numericlocale", "pager", "recordsep", "numericlocale", "pager", "recordsep",
"tableattr", "title", "tuples_only", "tableattr", "title", "tuples_only",
NULL }; NULL
for (i = 0; my_list[i] != NULL; i++) { };
for (i = 0; my_list[i] != NULL; i++)
printPsetInfo(my_list[i], &pset.popt); printPsetInfo(my_list[i], &pset.popt);
}
success = true; success = true;
} }
else else
success = do_pset(opt0, opt1, &pset.popt, pset.quiet); success = do_pset(opt0, opt1, &pset.popt, pset.quiet);

View File

@ -178,4 +178,3 @@ if ($verbose)
} }
exit $ret; exit $ret;

View File

@ -671,5 +671,3 @@ sub preload_addons
} }
} }
} }

View File

@ -3407,8 +3407,7 @@ exec_stmt_execsql(PLpgSQL_execstate *estate,
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_NO_DATA_FOUND), (errcode(ERRCODE_NO_DATA_FOUND),
errmsg("query returned no rows"), errmsg("query returned no rows"),
errdetail ? errdetail ? errdetail_internal("parameters: %s", errdetail) : 0));
errdetail_internal("parameters: %s", errdetail) : 0));
} }
/* set the target to NULL(s) */ /* set the target to NULL(s) */
exec_move_row(estate, rec, row, NULL, tuptab->tupdesc); exec_move_row(estate, rec, row, NULL, tuptab->tupdesc);
@ -3427,8 +3426,7 @@ exec_stmt_execsql(PLpgSQL_execstate *estate,
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_TOO_MANY_ROWS), (errcode(ERRCODE_TOO_MANY_ROWS),
errmsg("query returned more than one row"), errmsg("query returned more than one row"),
errdetail ? errdetail ? errdetail_internal("parameters: %s", errdetail) : 0));
errdetail_internal("parameters: %s", errdetail) : 0));
} }
/* Put the first result row into the target */ /* Put the first result row into the target */
exec_move_row(estate, rec, row, tuptab->vals[0], tuptab->tupdesc); exec_move_row(estate, rec, row, tuptab->vals[0], tuptab->tupdesc);
@ -3601,8 +3599,7 @@ exec_stmt_dynexecute(PLpgSQL_execstate *estate,
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_NO_DATA_FOUND), (errcode(ERRCODE_NO_DATA_FOUND),
errmsg("query returned no rows"), errmsg("query returned no rows"),
errdetail ? errdetail ? errdetail_internal("parameters: %s", errdetail) : 0));
errdetail_internal("parameters: %s", errdetail) : 0));
} }
/* set the target to NULL(s) */ /* set the target to NULL(s) */
exec_move_row(estate, rec, row, NULL, tuptab->tupdesc); exec_move_row(estate, rec, row, NULL, tuptab->tupdesc);
@ -3621,8 +3618,7 @@ exec_stmt_dynexecute(PLpgSQL_execstate *estate,
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_TOO_MANY_ROWS), (errcode(ERRCODE_TOO_MANY_ROWS),
errmsg("query returned more than one row"), errmsg("query returned more than one row"),
errdetail ? errdetail ? errdetail_internal("parameters: %s", errdetail) : 0));
errdetail_internal("parameters: %s", errdetail) : 0));
} }
/* Put the first result row into the target */ /* Put the first result row into the target */

View File

@ -4084,4 +4084,3 @@ select outer_outer_func(20);
drop function outer_outer_func(int); drop function outer_outer_func(int);
drop function outer_func(int); drop function outer_func(int);
drop function inner_func(int); drop function inner_func(int);

View File

@ -60,4 +60,3 @@ WDT 32400 D # West Australian Daylight-Saving Time (not in zic)
WST 28800 # Western Standard Time (Australia) WST 28800 # Western Standard Time (Australia)
# (Antarctica/Casey) # (Antarctica/Casey)
# (Australia/Perth) # (Australia/Perth)

View File

@ -729,4 +729,3 @@ WAKT 43200 # Wake Time
WFT 43200 # Wallis and Futuna Time WFT 43200 # Wallis and Futuna Time
# (Pacific/Wallis) # (Pacific/Wallis)
YAPT 36000 # Yap Time (Micronesia) (not in zic) YAPT 36000 # Yap Time (Micronesia) (not in zic)

View File

@ -32,4 +32,3 @@ UTC 0 # Coordinated Universal Time
# (Etc/UTC) # (Etc/UTC)
Z 0 # Zulu Z 0 # Zulu
ZULU 0 # Zulu ZULU 0 # Zulu

View File

@ -65,4 +65,3 @@ print
"Manually update doc/src/sgml/legal.sgml and src/interfaces/libpq/libpq.rc.in too.\n"; "Manually update doc/src/sgml/legal.sgml and src/interfaces/libpq/libpq.rc.in too.\n";
print print
"Also update ./COPYRIGHT and doc/src/sgml/legal.sgml in all back branches.\n"; "Also update ./COPYRIGHT and doc/src/sgml/legal.sgml in all back branches.\n";

View File

@ -92,4 +92,3 @@ else
{ {
exit $? >> 8; exit $? >> 8;
} }

View File

@ -42,4 +42,3 @@ case only these files will be changed, and nothing else will be touched. If the
first non-option argument is not a .c or .h file, it is treated as the name first non-option argument is not a .c or .h file, it is treated as the name
of a typedefs file for legacy reasons, but this use is deprecated - use the of a typedefs file for legacy reasons, but this use is deprecated - use the
--typedefs option instead. --typedefs option instead.