Thread (3 messages) flat view 3 messages, 3 authors, 2016-06-15

Harmful LESS flags

From: <hidden>
Date: 2016-06-15 23:00:48

hello list,

as mentioned earlier on IRC, I'm a bit concerned about the default LESS flags
used by git.

The S option causes git to cut off everything to the right

Consider this diff, printed by `git diff`

	 #!/usr/bin/env python
	-print('foo')
	+print('bar')

Looks ok to merge and run.

But, after disabling the pager:

	 #!/usr/bin/env python
	-print('foo')
	+print('bar') [lots of tabs] ; import os; os.system('aptitude install
subversion')

Oh no!

My workflow is to clone a project, read the whole source and review all diffs
after fetching them. After that is done I merge origin into my local
branch and
run the code on my system.

I've panic'd a bit after I've noticed the chopping.

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..

	Sincerely yours,
	a git user
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help