Skip to content

Commit db11712

Browse files
committed
update docs/helpers for unified format
1 parent 8ebf4df commit db11712

File tree

5 files changed

+30
-3
lines changed

5 files changed

+30
-3
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,30 @@ The backported patch to target version PC is as follows:
9292
> if (author_list[b].user_id < minimum) {
9393
> minimum = author_list[b].user_id;
9494
```
95+
If you prefer changes to display in unified diff format, use the additional flag
96+
"--format=unified"
97+
98+
```c
99+
--- /FixMorph/tests/update/assignment/PC/selection-sort.c
100+
+++ /FixMorph/tests/update/assignment/PC-patch/selection-sort.c
101+
102+
@@ -15,11 +15,11 @@
103+
while (a < length) {
104+
author_id = author_list[a].user_id;
105+
rank = author_list[a].rank;
106+
- minimum = rank;
107+
+ minimum = author_id;
108+
position = a;
109+
for (b = a + 1; b < length; b++) {
110+
- if (author_list[b].rank < minimum) {
111+
- minimum = author_list[b].rank;
112+
+ if (author_list[b].user_id < minimum) {
113+
+ minimum = author_list[b].user_id;
114+
position = b;
115+
}
116+
}
117+
```
118+
95119
Many such examples are included in the 'tests' directory, simply replace the configuration file path and run the same command as above.
96120

97121
# Limitations #

app/tools/emitter.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ def help():
187187
print("\t" + definitions.ARG_TIMEOUT + "\t| " + "timeout in minutes (default=60)")
188188
print("\t" + definitions.ARG_OPERATION_MODE + "\t| " + "select which tool/mode to run for backport {0: fixmorph, 1: patch, 2: patch-context, 3: sydit}")
189189
print("\t" + definitions.ARG_CONTEXT_LEVEL + "\t| " + "set context level for patch-context mode")
190+
print("\t" + definitions.ARG_OUTPUT_FORMAT + "\t| " + "select the output format for the diff change {'normal', 'unified'} (default = normal)")
190191

191192
print("Skip Phases\n-----------------------\n")
192193
print("\t" + definitions.ARG_SKIP_BUILD + "\t| " + "skip build")

app/tools/weaver.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def show_patch(file_a, file_b, file_c, file_d, index):
121121
emitter.highlight("\tOriginal Patch")
122122
original_patch_file_name = definitions.DIRECTORY_OUTPUT + "/" + index + "-original-patch"
123123
generated_patch_file_name = definitions.DIRECTORY_OUTPUT + "/" + index + "-generated-patch"
124-
diff_command = "diff -ENZBbwr"
124+
diff_command = "diff -ENZBbwr "
125125
if values.DEFAULT_OUTPUT_FORMAT == "unified":
126126
diff_command += " -u "
127127
diff_command += file_a + " " + file_b + " > " + original_patch_file_name
@@ -133,7 +133,7 @@ def show_patch(file_a, file_b, file_c, file_d, index):
133133
diff_line = diff.readline().strip()
134134

135135
emitter.highlight("\tGenerated Patch")
136-
diff_command = "diff -ENZBbwr"
136+
diff_command = "diff -ENZBbwr "
137137
if values.DEFAULT_OUTPUT_FORMAT == "unified":
138138
diff_command += " -u "
139139
diff_command += file_c + " " + file_d + " > " + generated_patch_file_name

doc/Manual.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ The tool supports the following runtime configurations:
3030
--debug | enable debugging information
3131
--mode= | execution mode [0: fixmorph 1: linux-patch-no-context 2: linux-patch-context 3: sydit] (default = 0)
3232
--context= | context level for linux-patch-context mode
33-
33+
--format= | select format for diff changes [normal, unified] (default=normal)
34+
3435

3536
### Side effects ###
3637

experiments/ISSTA21/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ docker pull rshariffdeen/fixmorph:issta21
4040
```
4141

4242
Having the image, you can now start a Docker container.
43+
Note: please make sure to use the correct image which has the dependencies installed for Linux kernel (i.e. rshariffdeen/fixmorph:issta21)
4344

4445
[comment]: <> (We recommend linking the container to folders in the filesystem,)
4546
[comment]: <> (so that it is possible to check the logs and generated outputs also outside of the Docker container. )

0 commit comments

Comments
 (0)