git/mergetools
brian m. carlson fedd5c79ff vimdiff: make script and tests work with zsh
When we process the $LAYOUT variable through sed, the result will end
with the character "#".  We then split it at the shell using IFS so that
we can process it a character at a time.

POSIX specifies that only "IFS white space shall be ignored at the
beginning and end of the input".  The hash mark is not a white space
character, so it is not ignored at the beginning and end of the input.

POSIX then specifies that "[e]ach occurrence in the input of an IFS
character that is not IFS white space, along with any adjacent IFS white
space, shall delimit a field, as described previously."  Thus, the final
hash mark delimits a field, and the final field is the empty string.

zsh implements this behavior strictly in compliance with POSIX (and
differently from most other shells), such that we end up with a trailing
empty field.  We don't want this empty field and processing it in the
normal way causes us to fail to parse properly and fail the tests with
"ERROR" entries, so let's just ignore it instead.  This is the behavior
of bash and dash anyway and what was clearly intended, so this is a
reasonable thing to do.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-04-26 16:31:46 -07:00
..
araxis mergetools: add description to all diff/merge tools 2022-04-03 15:10:04 -07:00
bc mergetools: add description to all diff/merge tools 2022-04-03 15:10:04 -07:00
codecompare mergetools: add description to all diff/merge tools 2022-04-03 15:10:04 -07:00
deltawalker mergetools: add description to all diff/merge tools 2022-04-03 15:10:04 -07:00
diffmerge mergetools: add description to all diff/merge tools 2022-04-03 15:10:04 -07:00
diffuse mergetools: add description to all diff/merge tools 2022-04-03 15:10:04 -07:00
ecmerge mergetools: add description to all diff/merge tools 2022-04-03 15:10:04 -07:00
emerge mergetools: add description to all diff/merge tools 2022-04-03 15:10:04 -07:00
examdiff mergetools: add description to all diff/merge tools 2022-04-03 15:10:04 -07:00
guiffy mergetools: add description to all diff/merge tools 2022-04-03 15:10:04 -07:00
gvimdiff
kdiff3 mergetools: add description to all diff/merge tools 2022-04-03 15:10:04 -07:00
kompare mergetools: add description to all diff/merge tools 2022-04-03 15:10:04 -07:00
meld mergetools: add description to all diff/merge tools 2022-04-03 15:10:04 -07:00
nvimdiff
opendiff mergetools: add description to all diff/merge tools 2022-04-03 15:10:04 -07:00
p4merge mergetools: add description to all diff/merge tools 2022-04-03 15:10:04 -07:00
smerge mergetools: add description to all diff/merge tools 2022-04-03 15:10:04 -07:00
tkdiff mergetools: add description to all diff/merge tools 2022-04-03 15:10:04 -07:00
tortoisemerge mergetools: add description to all diff/merge tools 2022-04-03 15:10:04 -07:00
vimdiff vimdiff: make script and tests work with zsh 2024-04-26 16:31:46 -07:00
winmerge mergetools: add description to all diff/merge tools 2022-04-03 15:10:04 -07:00
xxdiff mergetools: add description to all diff/merge tools 2022-04-03 15:10:04 -07:00