"small bag used by sailors for needles, thread, scissors, thimble, etc.," 1828, nautical slang, of uncertain origin, perhaps from the alleged British naval phrase commodity bag. Hence also ditty-box (1841).
Every true man-of-war's man knows how to cut out clothing with as much ease, and producing as correct a fit, as the best tailor. This is a necessity on board ship, for the ready-made clothing procured of the purser is never known to fit, being generally manufactured several sizes larger than necessary, in order that it may be re-cut and made in good style. [Charles Nordhoff, "The Young Man-of-War's Man," 1866]