only performs diff if f is a file and puts diff in head tree