Fix gethistory script

Change-Id: Icd6c7a751f3ca0fbf26da7d14bad2e42bd42714f