git diff encoding issue when running via Hyper-V

Polytropon freebsd at edvax.de
Wed Sep 30 16:35:41 UTC 2015


On Wed, 30 Sep 2015 16:21:57 +0000, Dangling Pointer wrote:
> # echo "This is ^[[31mred^[[m text."
> 
> 
> 
> prints red colored "red" text. :)
> 
> 
> 
> # git diff &1> ../blah.txt
> 
> # cat ../blah.txt
> 
> 
> 
> shows:
> 
> 
> 
> [...]
> 
> -setup_dirs()
> +setup_dirs2()
> 
> [...]
> 
> 
> 
> but
> 
> 
> 
> # git diff
> 
> 
> 
> still emits the mangled output on stdout.

This seems to suggest that git does not use the default pager
for output ("cat" or "less"). When you pipe the output to one
of those programs, like

	% git diff | cat

or

	% git diff | less

is the output different? Does the Git documentation provide some
clue about the pager it uses for its diff functionality?

The problem becomes more clear now.

 		 	   		  

-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...


More information about the freebsd-questions mailing list