File tree Expand file tree Collapse file tree 4 files changed +50
-0
lines changed Expand file tree Collapse file tree 4 files changed +50
-0
lines changed Original file line number Diff line number Diff line change 904
904
"default" : " none"
905
905
}
906
906
}
907
+ },
908
+ "--when" : {
909
+ "type" : " object" ,
910
+ "description" : " Conditions restriction the application of the configuration" ,
911
+ "properties" : {
912
+ "repositories" : {
913
+ "type" : " array" ,
914
+ "description" : " List of paths to match the repository path prefix" ,
915
+ "items" : {
916
+ "type" : " string"
917
+ }
918
+ },
919
+ "commands" : {
920
+ "type" : " array" ,
921
+ "description" : " List of subcommands to match" ,
922
+ "items" : {
923
+ "type" : " string"
924
+ }
925
+ }
926
+ }
927
+ },
928
+ "--scope" : {
929
+ "type" : " array" ,
930
+ "description" : " Scoped tables for conditional configuration" ,
931
+ "items" : {
932
+ "$comment" : " https://json-schema.org/understanding-json-schema/structuring#recursion" ,
933
+ "$ref" : " #"
934
+ }
907
935
}
908
936
}
909
937
}
Original file line number Diff line number Diff line change
1
+ # :schema ../../../src/config-schema.json
2
+
3
+ [[--scope ]]
4
+ --when.repositories = [" ~/repos/employer" ]
5
+ user.email = 5 # should error because it's not a string
Original file line number Diff line number Diff line change
1
+ # :schema ../../../src/config-schema.json
2
+
3
+ # configuring the formatting of timestamps only for the log command
4
+
5
+ [[--scope ]]
6
+ --when.commands = [" log" ]
7
+ template-aliases.'format_timestamp(timestamp)' = ' timestamp.ago()'
Original file line number Diff line number Diff line change
1
+ # :schema ../../../src/config-schema.json
2
+
3
+ # --when can be used at the top-level. This is useful when configuration is
4
+ # organized over several files.
5
+ --when.repositories = [" ~/repos/employer" ]
6
+
7
+ # This might be a file that represents all configuration that should apply to
8
+ # the set of repositories belonging to an employer. Setting a custom work email
9
+ # could be a common use case.
10
+
You can’t perform that action at this time.
0 commit comments