File tree Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ int advice_add_embedded_repo = 1;
28
28
int advice_ignored_hook = 1 ;
29
29
int advice_waiting_for_editor = 1 ;
30
30
int advice_graft_file_deprecated = 1 ;
31
+ int advice_unknown_index_extension = 1 ;
31
32
int advice_checkout_ambiguous_remote_branch_name = 1 ;
32
33
int advice_nested_tag = 1 ;
33
34
@@ -87,6 +88,7 @@ static struct {
87
88
{ "ignoredHook" , & advice_ignored_hook },
88
89
{ "waitingForEditor" , & advice_waiting_for_editor },
89
90
{ "graftFileDeprecated" , & advice_graft_file_deprecated },
91
+ { "unknownIndexExtension" , & advice_unknown_index_extension },
90
92
{ "checkoutAmbiguousRemoteBranchName" , & advice_checkout_ambiguous_remote_branch_name },
91
93
{ "nestedTag" , & advice_nested_tag },
92
94
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ extern int advice_add_embedded_repo;
28
28
extern int advice_ignored_hook ;
29
29
extern int advice_waiting_for_editor ;
30
30
extern int advice_graft_file_deprecated ;
31
+ extern int advice_unknown_index_extension ;
31
32
extern int advice_checkout_ambiguous_remote_branch_name ;
32
33
extern int advice_nested_tag ;
33
34
Original file line number Diff line number Diff line change @@ -1742,7 +1742,17 @@ static int read_index_extension(struct index_state *istate,
1742
1742
if (* ext < 'A' || 'Z' < * ext )
1743
1743
return error (_ ("index uses %.4s extension, which we do not understand" ),
1744
1744
ext );
1745
- fprintf_ln (stderr , _ ("ignoring %.4s extension" ), ext );
1745
+ if (advice_unknown_index_extension ) {
1746
+ warning (_ ("ignoring optional %.4s index extension" ), ext );
1747
+ advise (_ ("This is likely due to the file having been written by a newer\n"
1748
+ "version of Git than is reading it. You can upgrade Git to\n"
1749
+ "take advantage of performance improvements from the updated\n"
1750
+ "file format.\n"
1751
+ "\n"
1752
+ "Run \"%s\"\n"
1753
+ "to suppress this message." ),
1754
+ "git config advice.unknownIndexExtension false" );
1755
+ }
1746
1756
break ;
1747
1757
}
1748
1758
return 0 ;
You can’t perform that action at this time.
0 commit comments