Re: [PATCH 09/18] fsck: handle multiple authors in commits specially

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH 09/18] fsck: handle multiple authors in commits specially

From: Junio C Hamano <hidden>
Date: 2016-06-15 23:03:15

Johannes Schindelin [off-list ref] writes:
This problem has been detected in the wild, and is the primary reason
to introduce an option to demote certain fsck errors to warnings. Let's
offer to ignore this particular problem specifically.
...
+	while (skip_prefix(buffer, "author ", &buffer)) {
+		err = report(options, &commit->object, FSCK_MSG_MULTIPLE_AUTHORS, "invalid format - multiple 'author' lines");
+		if (err)
+			return err;
If we have an option to demote this to a warning, wouldn't we want
to do the same fsck_ident() on that secondary author line?
+		/* require_end_of_header() ensured that there is a newline */
+		buffer = strchr(buffer, '\n') + 1;
+	}
 	if (!skip_prefix(buffer, "committer ", &buffer))
 		return report(options, &commit->object, FSCK_MSG_MISSING_COMMITTER, "invalid format - expected 'committer' line");
 	err = fsck_ident(&buffer, &commit->object, options);

Re: [PATCH 09/18] fsck: handle multiple authors in commits specially

From: Johannes Schindelin <hidden>
Date: 2016-06-15 23:03:20

Hi Junio,

On Wed, 10 Dec 2014, Junio C Hamano wrote:
Johannes Schindelin [off-list ref] writes:
quoted
This problem has been detected in the wild, and is the primary reason
to introduce an option to demote certain fsck errors to warnings. Let's
offer to ignore this particular problem specifically.
...
+	while (skip_prefix(buffer, "author ", &buffer)) {
+		err = report(options, &commit->object, FSCK_MSG_MULTIPLE_AUTHORS, "invalid format - multiple 'author' lines");
+		if (err)
+			return err;
If we have an option to demote this to a warning, wouldn't we want
to do the same fsck_ident() on that secondary author line?
Good point! I changed the following to use fsck_ident() instead:
quoted
+		/* require_end_of_header() ensured that there is a newline */
+		buffer = strchr(buffer, '\n') + 1;
+	}
 	if (!skip_prefix(buffer, "committer ", &buffer))
 		return report(options, &commit->object, FSCK_MSG_MISSING_COMMITTER, "invalid format - expected 'committer' line");
 	err = fsck_ident(&buffer, &commit->object, options);
Ciao,
Dscho
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help