Dan Aloni <[email protected]> writes:
> These commits which have hashes starting with the hex string 'bad',
> always give me the chills. Why should a perfectly good commit be
> jinxed?
> ...
> Note that this change does not affect actual software quality maintained
> using Git. Thus, it is recommended keep testing all generated versions
> regardless of commit hash jinxes.
>
> Signed-off-by: Dan Aloni <[email protected]>
> ---
Ah, I forgot that it's that time of the year again.
> + ...
> + oid_hex = oid_to_hex(&oid);
> + if (prevent_bad &&
> + oid_hex[0] == 'b' &&
> + oid_hex[1] == 'a' &&
> + oid_hex[2] == 'd' )
> + {
> + parents = copy_parents;
> + strbuf_add(&sb, "\n", 1);
> + continue;
We used to allow a variant of this that lets you append invisible
cruft at the end of the log message by hiding it after a NUL. You
also could loop here to turn the abbreviated commit object name to
an actively good one, not just "not bad" name ;-).
> + }
> +
> + free_commit_list(copy_parents);
> + break;
> }
> +
> strbuf_release(&author_ident);
> free_commit_extra_headers(extra);