Thread (8 messages) flat view 8 messages, 3 authors, 2016-08-30

Re: [PATCH] diff-highlight: add some tests.

From: Junio C Hamano <hidden>
Date: 2016-08-19 22:31:30

Possibly related (same subject, not in this thread)

Jeff King [off-list ref] writes:
For that matter, I'm not sure that:

  cat >a <<-\EOF &&
  aaa
  bbb
  ccc
  EOF

  cat >b <<-\EOF &&
  aaa
  0bb
  ccc
  EOF

  dh_test a b <<\EOF
  aaa
  -${CW}b${CR}bb
  +${CW}0${CR}bb
  EOF

isn't more readable, too. It's more lines, certainly, but it makes it
very easy to see what the input files look like, rather than cramming
"\n" into the middle of a string (the existing code does make the diff
easy to see for _this_ case, because the pre- and post-image line up
vertically, but that is only the case for pure transliterations like
this).
Yeah, the simplicity and obviousness certainly is very tempting.

With something like

CW=$(printf "\033[7m")	# white
CR=$(printf "\033[27m") # reset

upfront, the test helper does not even need to worry about feeding a
random string through printf as if it is a format string.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help