Skip to content

Commit 359e6b6

Browse files
jrngitster
authored andcommitted
index: do not warn about unrecognized extensions
Documentation/technical/index-format explains: 4-byte extension signature. If the first byte is 'A'..'Z' the extension is optional and can be ignored. This allows gracefully introducing a new index extension without having to rely on all readers having support for it. Mandatory extensions start with a lowercase letter and optional ones start with a capital. Thus the versions of Git acting on a shared local repository do not have to upgrade in lockstep. We almost obey that convention, but there is a problem: when encountering an unrecognized optional extension, we write ignoring FNCY extension to stderr, which alarms users. This means that in practice we have had to introduce index extensions in two steps: first add read support, and then a while later, start writing by default. This delays when users can benefit from improvements to the index format. We cannot change the past, but for index extensions of the future, there is a straightforward improvement: silence that message except when tracing. This way, the message is still available when debugging, but in everyday use it does not show up so (once most Git users have this patch) we can turn on new optional extensions right away without alarming people. Signed-off-by: Jonathan Nieder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2a9dede commit 359e6b6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

read-cache.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1726,7 +1726,7 @@ static int read_index_extension(struct index_state *istate,
17261726
if (*ext < 'A' || 'Z' < *ext)
17271727
return error("index uses %.4s extension, which we do not understand",
17281728
ext);
1729-
fprintf(stderr, "ignoring %.4s extension\n", ext);
1729+
trace_printf("ignoring %.4s extension\n", ext);
17301730
break;
17311731
}
17321732
return 0;

0 commit comments

Comments
 (0)