get_data_by_changeId.sh
#!/bin/sh
if [ $# -lt 2 ]
then
echo "[usage]: ./get_date_by_changeId [project_location] [changeId]"
exit 1
fi
#func get the date line by changeId
get_date_by_changeId()
{
CURRENT_PATH=`pwd`
cd $1
git log --grep="$2" --pretty="%ad" --date=rfc
if [ $? ]
then
cd $CURRENT_PATH
return 1
else
cd $CURRENT_PATH
return 0
fi
}
DATE_CHANGED=`get_date_by_changeId $1 $2`
if [ -n "$DATE_CHANGED" ]
then
echo "$DATE_CHANGED"
fi