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
int advice_submodule_alternate_error_strategy_die = 1 ;
@@ -89,6 +90,7 @@ static struct {
89
90
{ "ignoredHook" , & advice_ignored_hook },
90
91
{ "waitingForEditor" , & advice_waiting_for_editor },
91
92
{ "graftFileDeprecated" , & advice_graft_file_deprecated },
93
+ { "unknownIndexExtension" , & advice_unknown_index_extension },
92
94
{ "checkoutAmbiguousRemoteBranchName" , & advice_checkout_ambiguous_remote_branch_name },
93
95
{ "nestedTag" , & advice_nested_tag },
94
96
{ "submoduleAlternateErrorStrategyDie" , & advice_submodule_alternate_error_strategy_die },
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
extern int advice_submodule_alternate_error_strategy_die ;
Original file line number Diff line number Diff line change @@ -1758,7 +1758,17 @@ static int read_index_extension(struct index_state *istate,
1758
1758
if (* ext < 'A' || 'Z' < * ext )
1759
1759
return error (_ ("index uses %.4s extension, which we do not understand" ),
1760
1760
ext );
1761
- fprintf_ln (stderr , _ ("ignoring %.4s extension" ), ext );
1761
+ if (advice_unknown_index_extension ) {
1762
+ warning (_ ("ignoring optional %.4s index extension" ), ext );
1763
+ advise (_ ("This is likely due to the file having been written by a newer\n"
1764
+ "version of Git than is reading it. You can upgrade Git to\n"
1765
+ "take advantage of performance improvements from the updated\n"
1766
+ "file format.\n"
1767
+ "\n"
1768
+ "Run \"%s\"\n"
1769
+ "to suppress this message." ),
1770
+ "git config advice.unknownIndexExtension false" );
1771
+ }
1762
1772
break ;
1763
1773
}
1764
1774
return 0 ;
You can’t perform that action at this time.
0 commit comments