When should test fixture scripts use the <<-
heredoc style?
#1423
-
The technical difference between the The
None of these have indented contents, much less the tab-intended contents needed for the However, one thing at least most of them do have is tab characters within their contents, just not as part of indentation. Therefore, before I convert any of these to It definitely shouldn't affect the behavior of the shell that interprets the script. But I am curious if it is put there to prevent some text editors from overzealously converting those non-indenting internal tab characters into spaces. I've been mostly using VS Code, which does not perform such a conversion even when I use the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
This is interesting! Since I am not really aware of this heredoc format, it's unlikely I would have used it intentionally. Maybe it's part of the Git test-suite where parts have been extracted from initially. Most of the usages are either with Thus, the answer might be in the Git test-suite - maybe the |
Beta Was this translation helpful? Give feedback.
This is interesting!
Since I am not really aware of this heredoc format, it's unlikely I would have used it intentionally. Maybe it's part of the Git test-suite where parts have been extracted from initially. Most of the usages are either with
git update-index
or somesed
script that I probably didn't write originally.Thus, the answer might be in the Git test-suite - maybe the
<<-
around thesed
line has a comment that would reveal if the-
was added later and for a specific reason.I most certainly have no reason for it and recommend removing
-
where it's not needed.This might then also be a good commit for the Git mailing list - they are always accepting cleanups and fixes.