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:
parent
dca09ac533
commit
001e114b8d
78 changed files with 303 additions and 288 deletions
34
.gitattributes
vendored
Normal file
34
.gitattributes
vendored
Normal 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
|
|
@ -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');
|
||||
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;
|
||||
|
||||
|
|
|
@ -368,8 +368,7 @@ usage(void)
|
|||
" -j, --jobs=NUM number of threads (default: 1)\n"
|
||||
" -l, --log write transaction times to log file\n"
|
||||
" -M, --protocol=simple|extended|prepared\n"
|
||||
" protocol for submitting queries "
|
||||
"(default: simple)\n"
|
||||
" protocol for submitting queries (default: simple)\n"
|
||||
" -n, --no-vacuum do not run VACUUM before tests\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"
|
||||
|
@ -377,8 +376,7 @@ usage(void)
|
|||
" -R, --rate=NUM target rate in transactions per second\n"
|
||||
" -s, --scale=NUM report this scale factor in output\n"
|
||||
" -S, --select-only perform SELECT-only transactions\n"
|
||||
" -t, --transactions number of transactions each client runs "
|
||||
"(default: 10)\n"
|
||||
" -t, --transactions number of transactions each client runs (default: 10)\n"
|
||||
" -T, --time=NUM duration of benchmark test in seconds\n"
|
||||
" -v, --vacuum-all vacuum all four standard tables before tests\n"
|
||||
" --aggregate-interval=NUM aggregate data over NUM seconds\n"
|
||||
|
|
|
@ -561,4 +561,3 @@ makeFuncCall(List *name, List *args, int location)
|
|||
n->over = NULL;
|
||||
return n;
|
||||
}
|
||||
|
||||
|
|
|
@ -2143,7 +2143,6 @@ process_log_prefix_padding(const char *p, int *ppadding)
|
|||
paddingsign = -1;
|
||||
}
|
||||
|
||||
|
||||
/* generate an int version of the numerical string */
|
||||
while (*p >= '0' && *p <= '9')
|
||||
padding = padding * 10 + (*p++ - '0');
|
||||
|
@ -2371,7 +2370,6 @@ log_line_prefix(StringInfo buf, ErrorData *edata)
|
|||
}
|
||||
else
|
||||
appendStringInfo(buf, "%*s", padding, MyProcPort->remote_host);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -1041,20 +1041,21 @@ exec_command(const char *cmd,
|
|||
|
||||
if (!opt0)
|
||||
{
|
||||
size_t i;
|
||||
/* list all variables */
|
||||
|
||||
int i;
|
||||
static const char *const my_list[] = {
|
||||
"border", "columns", "expanded", "fieldsep",
|
||||
"footer", "format", "linestyle", "null",
|
||||
"numericlocale", "pager", "recordsep",
|
||||
"tableattr", "title", "tuples_only",
|
||||
NULL };
|
||||
for (i = 0; my_list[i] != NULL; i++) {
|
||||
NULL
|
||||
};
|
||||
|
||||
for (i = 0; my_list[i] != NULL; i++)
|
||||
printPsetInfo(my_list[i], &pset.popt);
|
||||
}
|
||||
|
||||
success = true;
|
||||
|
||||
}
|
||||
else
|
||||
success = do_pset(opt0, opt1, &pset.popt, pset.quiet);
|
||||
|
|
|
@ -178,4 +178,3 @@ if ($verbose)
|
|||
}
|
||||
|
||||
exit $ret;
|
||||
|
||||
|
|
|
@ -671,5 +671,3 @@ sub preload_addons
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -3407,8 +3407,7 @@ exec_stmt_execsql(PLpgSQL_execstate *estate,
|
|||
ereport(ERROR,
|
||||
(errcode(ERRCODE_NO_DATA_FOUND),
|
||||
errmsg("query returned no rows"),
|
||||
errdetail ?
|
||||
errdetail_internal("parameters: %s", errdetail) : 0));
|
||||
errdetail ? errdetail_internal("parameters: %s", errdetail) : 0));
|
||||
}
|
||||
/* set the target to NULL(s) */
|
||||
exec_move_row(estate, rec, row, NULL, tuptab->tupdesc);
|
||||
|
@ -3427,8 +3426,7 @@ exec_stmt_execsql(PLpgSQL_execstate *estate,
|
|||
ereport(ERROR,
|
||||
(errcode(ERRCODE_TOO_MANY_ROWS),
|
||||
errmsg("query returned more than one row"),
|
||||
errdetail ?
|
||||
errdetail_internal("parameters: %s", errdetail) : 0));
|
||||
errdetail ? errdetail_internal("parameters: %s", errdetail) : 0));
|
||||
}
|
||||
/* Put the first result row into the target */
|
||||
exec_move_row(estate, rec, row, tuptab->vals[0], tuptab->tupdesc);
|
||||
|
@ -3601,8 +3599,7 @@ exec_stmt_dynexecute(PLpgSQL_execstate *estate,
|
|||
ereport(ERROR,
|
||||
(errcode(ERRCODE_NO_DATA_FOUND),
|
||||
errmsg("query returned no rows"),
|
||||
errdetail ?
|
||||
errdetail_internal("parameters: %s", errdetail) : 0));
|
||||
errdetail ? errdetail_internal("parameters: %s", errdetail) : 0));
|
||||
}
|
||||
/* set the target to NULL(s) */
|
||||
exec_move_row(estate, rec, row, NULL, tuptab->tupdesc);
|
||||
|
@ -3621,8 +3618,7 @@ exec_stmt_dynexecute(PLpgSQL_execstate *estate,
|
|||
ereport(ERROR,
|
||||
(errcode(ERRCODE_TOO_MANY_ROWS),
|
||||
errmsg("query returned more than one row"),
|
||||
errdetail ?
|
||||
errdetail_internal("parameters: %s", errdetail) : 0));
|
||||
errdetail ? errdetail_internal("parameters: %s", errdetail) : 0));
|
||||
}
|
||||
|
||||
/* Put the first result row into the target */
|
||||
|
|
|
@ -4084,4 +4084,3 @@ select outer_outer_func(20);
|
|||
drop function outer_outer_func(int);
|
||||
drop function outer_func(int);
|
||||
drop function inner_func(int);
|
||||
|
||||
|
|
|
@ -60,4 +60,3 @@ WDT 32400 D # West Australian Daylight-Saving Time (not in zic)
|
|||
WST 28800 # Western Standard Time (Australia)
|
||||
# (Antarctica/Casey)
|
||||
# (Australia/Perth)
|
||||
|
||||
|
|
|
@ -729,4 +729,3 @@ WAKT 43200 # Wake Time
|
|||
WFT 43200 # Wallis and Futuna Time
|
||||
# (Pacific/Wallis)
|
||||
YAPT 36000 # Yap Time (Micronesia) (not in zic)
|
||||
|
||||
|
|
|
@ -32,4 +32,3 @@ UTC 0 # Coordinated Universal Time
|
|||
# (Etc/UTC)
|
||||
Z 0 # Zulu
|
||||
ZULU 0 # Zulu
|
||||
|
||||
|
|
|
@ -65,4 +65,3 @@ print
|
|||
"Manually update doc/src/sgml/legal.sgml and src/interfaces/libpq/libpq.rc.in too.\n";
|
||||
print
|
||||
"Also update ./COPYRIGHT and doc/src/sgml/legal.sgml in all back branches.\n";
|
||||
|
||||
|
|
|
@ -92,4 +92,3 @@ else
|
|||
{
|
||||
exit $? >> 8;
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
of a typedefs file for legacy reasons, but this use is deprecated - use the
|
||||
--typedefs option instead.
|
||||
|
||||
|
|
Loading…
Reference in a new issue