You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To change this file edit the source file and then run MarkdownSnippets.
6
+
-->
7
+
8
+
# Code versus machine level settings
9
+
10
+
The approach to when a config setting is either a code based API or a machine level environment variable is driven by if the setting is a personal preference or shared.
11
+
12
+
13
+
## Personal preferences
14
+
15
+
Settings that are personal preferences ideally should
16
+
17
+
* Not be share with other people using the same code base.
18
+
* When running on the same machine, operate the same for different code bases that all use DiffEngine.
19
+
* Not apply to CI.
20
+
21
+
Examples:
22
+
23
+
*[Custom order](diff-tool.order.md#custom-order) which depend on the tools a specific person has installed.
Copy file name to clipboardExpand all lines: docs/diff-tool.custom.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,7 @@ var resolvedTool = DiffTools.AddTool(
23
23
exePath: diffToolPath,
24
24
binaryExtensions: new[] {"jpg"})!;
25
25
```
26
-
<sup><ahref='/src/Tests/DiffToolsTest.cs#L24-L35'title='File snippet `addtool` was extracted from'>snippet source</a> | <ahref='#snippet-addtool'title='Navigate to start of snippet `addtool`'>anchor</a></sup>
26
+
<sup><ahref='/src/Tests/DiffToolsTest.cs#L23-L34'title='File snippet `addtool` was extracted from'>snippet source</a> | <ahref='#snippet-addtool'title='Navigate to start of snippet `addtool`'>anchor</a></sup>
27
27
<!-- endsnippet -->
28
28
29
29
Add a tool based on existing resolved tool:
@@ -36,7 +36,7 @@ var resolvedTool = DiffTools.AddToolBasedOn(
<sup><ahref='/src/Tests/DiffToolsTest.cs#L65-L70'title='File snippet `addtoolbasedon` was extracted from'>snippet source</a> | <ahref='#snippet-addtoolbasedon'title='Navigate to start of snippet `addtoolbasedon`'>anchor</a></sup>
39
+
<sup><ahref='/src/Tests/DiffToolsTest.cs#L64-L69'title='File snippet `addtoolbasedon` was extracted from'>snippet source</a> | <ahref='#snippet-addtoolbasedon'title='Navigate to start of snippet `addtoolbasedon`'>anchor</a></sup>
40
40
<!-- endsnippet -->
41
41
42
42
@@ -49,7 +49,7 @@ New tools are added to the top of the order, the last tool added will resolve be
49
49
```cs
50
50
DiffRunner.Launch(tempFile, targetFile);
51
51
```
52
-
<sup><ahref='/src/Tests/DiffRunnerTests.cs#L21-L23'title='File snippet `diffrunnerlaunch` was extracted from'>snippet source</a> | <ahref='#snippet-diffrunnerlaunch'title='Navigate to start of snippet `diffrunnerlaunch`'>anchor</a></sup>
52
+
<sup><ahref='/src/Tests/DiffRunnerTests.cs#L20-L22'title='File snippet `diffrunnerlaunch` was extracted from'>snippet source</a> | <ahref='#snippet-diffrunnerlaunch'title='Navigate to start of snippet `diffrunnerlaunch`'>anchor</a></sup>
53
53
<!-- endsnippet -->
54
54
55
55
Alternatively the instance returned from `AddTool*` can be used to explicitly launch that tool.
@@ -64,7 +64,7 @@ var resolvedTool = DiffTools.AddToolBasedOn(
<sup><ahref='/src/Tests/DiffToolsTest.cs#L79-L86'title='File snippet `addtoolandlaunch` was extracted from'>snippet source</a> | <ahref='#snippet-addtoolandlaunch'title='Navigate to start of snippet `addtoolandlaunch`'>anchor</a></sup>
67
+
<sup><ahref='/src/Tests/DiffToolsTest.cs#L78-L85'title='File snippet `addtoolandlaunch` was extracted from'>snippet source</a> | <ahref='#snippet-addtoolandlaunch'title='Navigate to start of snippet `addtoolandlaunch`'>anchor</a></sup>
Copy file name to clipboardExpand all lines: docs/diff-tool.md
+9-1Lines changed: 9 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,12 +48,20 @@ By default a maximum of 5 tool instances will be launched. This prevents a chang
48
48
49
49
This value can be changed:
50
50
51
+
52
+
### Using an environment variable
53
+
54
+
Setting the `DiffEngine.MaxInstances` environment variable to the number of instances to launch.
55
+
56
+
57
+
### Using code
58
+
51
59
<!-- snippet: MaxInstancesToLaunch -->
52
60
<aid='snippet-maxinstancestolaunch'/></a>
53
61
```cs
54
62
DiffRunner.MaxInstancesToLaunch(10);
55
63
```
56
-
<sup><ahref='/src/Tests/DiffToolsTest.cs#L13-L17'title='File snippet `maxinstancestolaunch` was extracted from'>snippet source</a> | <ahref='#snippet-maxinstancestolaunch'title='Navigate to start of snippet `maxinstancestolaunch`'>anchor</a></sup>
64
+
<sup><ahref='/src/Tests/DiffToolsTest.cs#L12-L16'title='File snippet `maxinstancestolaunch` was extracted from'>snippet source</a> | <ahref='#snippet-maxinstancestolaunch'title='Navigate to start of snippet `maxinstancestolaunch`'>anchor</a></sup>
<sup><ahref='/src/Tests/DiffToolsTest.cs#L116-L118'title='File snippet `useorder` was extracted from'>snippet source</a> | <ahref='#snippet-useorder'title='Navigate to start of snippet `useorder`'>anchor</a></sup>
54
+
<sup><ahref='/src/Tests/DiffToolsTest.cs#L115-L117'title='File snippet `useorder` was extracted from'>snippet source</a> | <ahref='#snippet-useorder'title='Navigate to start of snippet `useorder`'>anchor</a></sup>
The approach to when a config setting is either a code based API or a machine level environment variable is driven by if the setting is a personal preference or shared.
4
+
5
+
6
+
## Personal preferences
7
+
8
+
Settings that are personal preferences ideally should
9
+
10
+
* Not be share with other people using the same code base.
11
+
* When running on the same machine, operate the same for different code bases that all use DiffEngine.
12
+
* Not apply to CI.
13
+
14
+
Examples:
15
+
16
+
*[Custom order](diff-tool.order.md#custom-order) which depend on the tools a specific person has installed.
*[Custom Tool](/docs/diff-tool.custom.md)<!-- end include: doc-index. path: /docs/mdsource/doc-index.include.md -->
36
+
*[Custom Tool](/docs/diff-tool.custom.md)
37
+
*[Code versus machine level settings](/docs/code-verus-machine-settings.md)<!-- end include: doc-index. path: /docs/mdsource/doc-index.include.md -->
37
38
38
39
39
40
## NuGet package
@@ -76,7 +77,7 @@ A tool can be launched using the following:
76
77
```cs
77
78
DiffRunner.Launch(tempFile, targetFile);
78
79
```
79
-
<sup><ahref='/src/Tests/DiffRunnerTests.cs#L21-L23'title='File snippet `diffrunnerlaunch` was extracted from'>snippet source</a> | <ahref='#snippet-diffrunnerlaunch'title='Navigate to start of snippet `diffrunnerlaunch`'>anchor</a></sup>
80
+
<sup><ahref='/src/Tests/DiffRunnerTests.cs#L20-L22'title='File snippet `diffrunnerlaunch` was extracted from'>snippet source</a> | <ahref='#snippet-diffrunnerlaunch'title='Navigate to start of snippet `diffrunnerlaunch`'>anchor</a></sup>
80
81
<!-- endsnippet -->
81
82
82
83
Note that this method will respect the above [difference behavior](/docs/diff-tool.md#detected-difference-behavior) in terms of Auto refresh and MDI behaviors.
@@ -91,15 +92,15 @@ A tool can be closed using the following:
91
92
```cs
92
93
DiffRunner.Kill(tempFile, targetFile);
93
94
```
94
-
<sup><ahref='/src/Tests/DiffRunnerTests.cs#L31-L33'title='File snippet `diffrunnerkill` was extracted from'>snippet source</a> | <ahref='#snippet-diffrunnerkill'title='Navigate to start of snippet `diffrunnerkill`'>anchor</a></sup>
95
+
<sup><ahref='/src/Tests/DiffRunnerTests.cs#L30-L32'title='File snippet `diffrunnerkill` was extracted from'>snippet source</a> | <ahref='#snippet-diffrunnerkill'title='Navigate to start of snippet `diffrunnerkill`'>anchor</a></sup>
95
96
<!-- endsnippet -->
96
97
97
98
Note that this method will respect the above [difference behavior](/docs/diff-tool.md#detected-difference-behavior) in terms of MDI behavior.
98
99
99
100
100
101
## File type detection
101
102
102
-
DiffEngine use [EmptyFiles](https://github.com/SimonCropp/EmptyFiles) to determine if a given file or extension is a binary or text.
103
+
DiffEngine use [EmptyFiles](https://github.com/SimonCropp/EmptyFiles) to determine if a given file or extension is a binary or text. Custom extensions can be added, or existing ones changed.
Copy file name to clipboardExpand all lines: readme.source.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,7 +47,7 @@ Note that this method will respect the above [difference behavior](/docs/diff-to
47
47
48
48
## File type detection
49
49
50
-
DiffEngine use [EmptyFiles](https://github.com/SimonCropp/EmptyFiles) to determine if a given file or extension is a binary or text.
50
+
DiffEngine use [EmptyFiles](https://github.com/SimonCropp/EmptyFiles) to determine if a given file or extension is a binary or text. Custom extensions can be added, or existing ones changed.
0 commit comments