Re: [bug] Multiline value should error if the next line is section
To
Martin Ågren
Cc
Shulhan
Git Mailing List
From
brian m. carlson
See Also
Prev Ref 1
Date
2018-05-06 21:09:43 UTC
On Sun, May 06, 2018 at 10:03:10PM +0200, Martin Ågren wrote:
> This behavior looks correct to me, though. It seems very hard to me to
> second-guess what the user meant. For example, what if that third line
> contained a "="? Like:
> 
> [alias]
>         huh = !dd \
>               bs=1024 ...
> 
> Should Git guess that the backslash on the second line was a mistake?
> Or maybe not, because alias.bs = "1024 ..." would be a useless alias?
> 
> I think such guessing would be theoretically possible, but especially if
> Git guesses wrong, that could be very frustrating to fight against.

I agree that trying to guess what the user wanted here is likely
impossible.

Furthermore, Git intentionally ignores unknown options.  For example, I
have advice and diff options set in my .gitconfig that would not be
valid on the Git shipped with a base CentOS 6 (which, unfortunately, I
sometimes have to use).  It's very convenient for users working across a
variety of systems that unknown options are simply ignored, even if that
means sometimes mistakes are not caught.
-- 
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.2.5 (GNU/Linux)

iQIzBAABCgAdFiEEX8OngXdrJt+H9ww3v1NdgR9S9osFAlrvbxcACgkQv1NdgR9S
9otXIhAAg3/0UVaZXxugCs9q6P8PpwRlfHCTbZ2B5NMNZAUgJzXD8sAWAL7F2FdC
uuHSxWwJPgclfo4NjX6YoU9r+cdn5yCGM15Hz+P/QPXJALshABxh5uAv42MWhzqP
D6M8bsgBgZcO+fkDgHmI3efK+jXH0FHrYs3C0oF9a9VN5kRap5DwDdMwRdEf74UZ
1J61Aj5E3Hb5NPVu3tnRMOehT3uISlN44LqT9durrQwkz/5/iHZx6B7sFE9XwiFp
hIOjI5Jf2+HNKA89xzQH67kfeGsO7+e1lQO5hzy28XIzl65LT3gBX81y6JSauJ9X
JuTOS8nyoNCgnoWj5m/0eRV07G0Ji4Bg466WiFTAX9yrMMWsgYQ78Gbw9N4gbcGG
Uhy2EfZpn19fGc4Izl3nU6Doj8oTHf/BQd+CltjLZXNG5uPs2+p7dnUFn7ziFcOq
aSvkGLXP05obuK1iu9iFlEnmBKNsJJ9SGcGgUSrsXswwNXFu5bpN8iKjtxbpMTwc
Dh77+3tHM4sXenMQUSLnKf6BYLTaBEiMeHVuedj90vaJwSeJ0QACRNObLa/RWmbl
yU+EOlZYftvM8jWM1hqcQK45QgNFWFiod54wyWMMmx7g1saNMlcLWmVGwqFCw/Qx
QcsFGLtLt+Z2n60opP2P0kKGo5SuYTpebioiz4aAUGmEFLjr7s8=
=WzUo
-----END PGP SIGNATURE-----