We study the generation of picosecond pulses by gain-switching of distributed feedback ridge-waveguide laser diodes. By pumping with short current pulses without d.c. bias, we obtain laser pulses with peak powers above 1 W at a wavelength around 1065 nm. These pulses exhibit strong spectral dynamics stemming from mode competition after switch-on. Typically, emission begins with a broad spectrum, before narrowing down to the Bragg line within a few hundred picoseconds. This dynamic behavior is studied in detail both experimentally and numerically for a variety of grating parameters. Using a rate-equation model with two species of photons, we achieve excellent agreement between simulation and experiment. In conclusion, we discuss the optimization of DFB laser diodes for short pulse generation.