Re: [PATCH v2] grep: support the --pathspec-from-file option
From: Junio C Hamano <hidden>
Date: 2019-12-04 21:25:05
Denton Liu [off-list ref] writes:
quoted
+--pathspec-file-nul:: + Only meaningful with `--pathspec-from-file`. Pathspec elements are + separated with NUL character and all other characters are taken + literally (including newlines and quotes).Does it make sense to have a corresponding --patterns-file-nul option?
I do not think so. "grep" is always record oriented and the record separter is the LF, so patterns file can safely be delimited with LF.
quoted
+test_expect_success 'setup pathspecs-file tests' ' +cat >excluded-file <<EOF && +bar +EOF ... +git add excluded-file pathspec-file unrelated-file +'Could you please change these here-docs to be <<-\EOF and then indent the test case?
Good suggestion. test_expect_success 'setup ...' ' cat >excluded-file <<-\EOF && bar EOF ... git add ... ' If each line in these files consists of a short single token (which seems to be the case), perhaps consider using test_write_lines? test_write_lines >excluded-file bar && test_write_lines >pathspec-file foo bar baz && test_write_lines >unrelated-file xyz && test_write_lines >pathspecs pathspec-file unrelated-file &&