FYI, if you just do /petattack, you will automagically target the nearest enemy (including PVP enemies) if you do not have a target. This can cause...unexpected results at times. I have my petattack macro as follows:

/assist focus
/petdefensive
/stopmacro [noharm]
/petattack

Then my pet follow (aka "COME HERE, STUPID!") macro is:

/petfollow
/petpassive

Works for me and doesn't get me into "oops" situations if I mistype and hit that key in a bad spot.