Thread (1 message) 1 message, 1 author, 2022-09-01

Re: [PATCH v2 1/3] diff: have submodule_format logic avoid additional diff headers

From: Junio C Hamano <hidden>
Date: 2022-09-01 16:30:08

"Elijah Newren via GitGitGadget" [off-list ref] writes:


As there is no guarantee that we'd never add another hack to use a
different kind of "phoney" filepair to diff_queue for another
purpose, either the name of the helper function, or a comment in
front of it, should say something that is sufficient to help readers
understand ...
+static int diff_filepair_is_phoney(struct diff_filespec *one,
+				   struct diff_filespec *two)
+{
+	return !DIFF_FILE_VALID(one) && !DIFF_FILE_VALID(two);
+}
...
-	if (!DIFF_FILE_VALID(one) && !DIFF_FILE_VALID(two)) {
+	if (diff_filepair_is_phoney(one, two)) {
 		/*
 		 * We should only reach this point for pairs from
 		 * create_filepairs_for_header_only_notifications().  For
... some of what this comment said, i.e. the pair that was added by
create_filepairs_for_header_only_notifications() is what the helper
detects. 

Other than that, the whole series looks good.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help