sqitchers / sqitch

Sensible database change management
https://sqitch.org
MIT License
2.78k stars 216 forks source link

Trim change description before hashing them. #106

Closed rdunklau closed 11 years ago

rdunklau commented 11 years ago

The change description is part of the change id. It would be great to trim it before hashing it. For example, if someone leaves a trailing space at the end of the change description, and someone else later removes it, the (deployed) change cannot be found in the plan anymore, resulting in a hard-to-track error.

theory commented 11 years ago

The note should always be trimmed already, both in the constructor and in the prompt code, which is the only place the note attribute should be written to other than the constructor.

rdunklau commented 11 years ago

I just tested this against the git version, and I was able to reproduce it:

Result: Cannot find 0b73975c9c5108da5fd125a725873b569bc7caa8 in the plan

theory commented 11 years ago

Hrm. For some reason, I made it so that only vertical whitespace was trimmed. No idea why I did that.