git diff encoding issue when running via Hyper-V

Dangling Pointer danglingpointer at outlook.com
Wed Sep 30 16:48:09 UTC 2015


Brilliant, this is fixed by running:

# git config --global core.pager 'less -+F'

I first checked with:

# git diff | cat
# git diff | more
# git diff | less

and it was showing the desired output. Setting the pager is showing colored output! =)

Thanks again Polytropon! I would have never known it without the "pager" keyword. 


> Date: Wed, 30 Sep 2015 18:35:38 +0200
> From: freebsd at edvax.de
> To: danglingpointer at outlook.com
> Subject: Re: git diff encoding issue when running via Hyper-V
> CC: freebsd-questions at freebsd.org
> 
> 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, ...
> _______________________________________________
> freebsd-questions at freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-questions
> To unsubscribe, send any mail to "freebsd-questions-unsubscribe at freebsd.org" 		 	   		  


More information about the freebsd-questions mailing list