It's clear in the 172 POH (mine's a M 1974 model) :
"When using an external power source, the position of the master switch is important. External power may be used for cold weather starting and during lengthy maintenance work on the electrical system. Just before connecting an external power source, the master switch should be turned on. Battery and external power circuits have been designed to completely eliminatethe need to jumper across the battary contactor to close it for charging a completely dead battery. With a dead battery and external power source applied, turning on the master switch will close the battery contactor."
Same info in the C152 manual with additional note "Turning on the master switch is especially important since it will enable the battery to absorb transient voltages which otherwise might damage the transistors in the electrical equipment."