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 @@ -25,6 +25,7 @@ int advice_add_embedded_repo = 1;
25
25
int advice_ignored_hook = 1 ;
26
26
int advice_waiting_for_editor = 1 ;
27
27
int advice_graft_file_deprecated = 1 ;
28
+ int advice_unknown_index_extension = 1 ;
28
29
int advice_checkout_ambiguous_remote_branch_name = 1 ;
29
30
int advice_nested_tag = 1 ;
30
31
@@ -81,6 +82,7 @@ static struct {
81
82
{ "ignoredHook" , & advice_ignored_hook },
82
83
{ "waitingForEditor" , & advice_waiting_for_editor },
83
84
{ "graftFileDeprecated" , & advice_graft_file_deprecated },
85
+ { "unknownIndexExtension" , & advice_unknown_index_extension },
84
86
{ "checkoutAmbiguousRemoteBranchName" , & advice_checkout_ambiguous_remote_branch_name },
85
87
{ "nestedTag" , & advice_nested_tag },
86
88
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ extern int advice_add_embedded_repo;
25
25
extern int advice_ignored_hook ;
26
26
extern int advice_waiting_for_editor ;
27
27
extern int advice_graft_file_deprecated ;
28
+ extern int advice_unknown_index_extension ;
28
29
extern int advice_checkout_ambiguous_remote_branch_name ;
29
30
extern int advice_nested_tag ;
30
31
Original file line number Diff line number Diff line change @@ -1720,7 +1720,17 @@ static int read_index_extension(struct index_state *istate,
1720
1720
if (* ext < 'A' || 'Z' < * ext )
1721
1721
return error (_ ("index uses %.4s extension, which we do not understand" ),
1722
1722
ext );
1723
- fprintf_ln (stderr , _ ("ignoring %.4s extension" ), ext );
1723
+ if (advice_unknown_index_extension ) {
1724
+ warning (_ ("ignoring optional %.4s index extension" ), ext );
1725
+ advise (_ ("This is likely due to the file having been written by a newer\n"
1726
+ "version of Git than is reading it. You can upgrade Git to\n"
1727
+ "take advantage of performance improvements from the updated\n"
1728
+ "file format.\n"
1729
+ "\n"
1730
+ "Run \"%s\"\n"
1731
+ "to suppress this message." ),
1732
+ "git config advice.unknownIndexExtension false" );
1733
+ }
1724
1734
break ;
1725
1735
}
1726
1736
return 0 ;
You can’t perform that action at this time.
0 commit comments