git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Harmful LESS flags

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 24, 2014, 19:02 UTC
Message-ID
<xmqqha5iv9eb.fsf@gitster.dls.corp.google.com>
In-Reply-To
<87lhuvb9kr.fsf@fencepost.gnu.org>
David Kastrup <dak@gnu.org> writes:
Show 14 quoted lines
> d9ba@mailtor.net writes:
>
>> It would be nice if we could change the flags to either
>>
>>  a) avoid cutting off
>>  b) indicate something has been cut off (<- I prefer this)
>>
>> I assume there are more people with a similar workflow who're still
>> unaware of this feature.
>>
>> I would joke about how 3 letter agencies introduced this flag to
>> backdoor open source projects, but, well..
>
> Most terminals are wider than three letters.

I am having a hard time to decide if you genuinely misread what you are responding to, or if you are joking. If the latter, I find the joke mildly funny in a twisted way ;-)

But the tangent aside...
Show 7 quoted lines
> Still, it is a total nuisance.  I am constantly doing
>
> -S RET
>
> on my git output.  This should be left alone as an entirely personal
> preference quite unrelated to Git.  There is no point in having Git
> configure a default different from what is used elsewhere.

I almost agree with the general principle of the last sentence, but with a bit of reservation. The default value for LESS (i.e. when the user does not have any) we pass is FRSX, and the Porcelain output these days is colored by default. If we don't set a default at all, the end-user experience for a newbie will be bad, especially without "R".

Among the other three, F and X are to avoid a short output (e.g "git show" on a one-liner with a short explanation) from asking for confirmation to leave the pager and from clearing the screen upon leaving the pager, and are generally accepted as good things (or at least, we haven't seen much issue raised after we started passing the default LESS for those who do not have their own in their environment).

Use of S is very subjective. While I personally do appreciate that we have it by default, I can perfectly well understand why some people do not want to see it in the default. The best we can do is to arrange so that people from one of the camps have their favorite out of the box and those from the other camp need to tell Git that they want to (or do not want to) fold long lines.

Traditionally, because the tool grew in a context of being used in a project whose participants are at least not malicious, always having to be on the lookout for fear of middle-of-line tabs hiding bad contents near the right edges of lines has never been an issue. If somebody brought up a potential issue of such mode of attack back then, Linus may have chosen the default differently. I may have myself chosen not to have S, if I were the maintainer when the LESS default was originally introduced, and had I been made aware of this issue.

I am not opposed to changing the default in the longer term, as long as we have a solid transition plan to ensure that it won't disrupt and/or upset existing users too much.

Previous: David KastrupNext: David Kastrup
Message 5 of 41 in “Harmful LESS flags”
  1. d9ba@mailtor.netApr 23, 2014
  2. Jonathan NiederApr 24, 2014
  3. Mark NudelmanApr 28, 2014
  4. David KastrupApr 24, 2014
  5. Junio C HamanoApr 24, 2014
  6. David KastrupApr 24, 2014
  7. Junio C HamanoApr 24, 2014
  8. David KastrupApr 24, 2014
  9. Jeff KingApr 24, 2014
  10. Junio C HamanoApr 24, 2014
  11. Jeff KingApr 24, 2014
  12. David KastrupApr 24, 2014
  13. Jeff KingApr 24, 2014
  14. David KastrupApr 24, 2014
  15. Jonathan NiederApr 24, 2014
  16. Matthieu MoyApr 25, 2014
  17. Jonathan NiederApr 25, 2014
  18. David KastrupApr 25, 2014
  19. Jonathan NiederApr 25, 2014
  20. PAGER_ENV: remove 'S' from $LESS by defaultMatthieu Moy, Apr 28, 2014
  21. David KastrupApr 28, 2014
  22. Matthieu MoyApr 28, 2014
  23. David KastrupApr 28, 2014
  24. Matthieu MoyApr 28, 2014
  25. Jeff KingApr 28, 2014
  26. Junio C HamanoApr 28, 2014
  27. Matthieu MoyApr 29, 2014
  28. Junio C HamanoApr 29, 2014
  29. pager: remove 'S' from $LESS by defaultMatthieu Moy, Apr 30, 2014
  30. Junio C HamanoApr 30, 2014
  31. Matthieu MoyApr 30, 2014
  32. Junio C HamanoApr 30, 2014
  33. Jonathan NiederMay 5, 2014
  34. Matthieu MoyMay 5, 2014
  35. Junio C HamanoMay 6, 2014
  36. David KastrupMay 6, 2014
  37. Matthieu MoyMay 6, 2014
  38. Jeff KingMay 6, 2014
  39. Junio C HamanoMay 7, 2014
  40. Matthieu MoyMay 7, 2014
  41. Junio C HamanoMay 7, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.