git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Dan Aloni <alonid@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] builtin/commit.c: prevent bad commits
Date: Sun, 01 Apr 2018 09:37:51 -0700	[thread overview]
Message-ID: <xmqq4lku2880.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <20180401140650.18928-1-alonid@gmail.com> (Dan Aloni's message of "Sun, 1 Apr 2018 17:06:50 +0300")

Dan Aloni <alonid@gmail.com> 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 <alonid@gmail.com>
> ---

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);

  reply	other threads:[~2018-04-01 16:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-01 14:06 [PATCH] builtin/commit.c: prevent bad commits Dan Aloni
2018-04-01 16:37 ` Junio C Hamano [this message]
2018-04-01 22:50 ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqq4lku2880.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=alonid@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).