]> Sergey Matveev's repositories - nnn.git/commitdiff
Update patch conflict instructions/workflow
authorLuuk van Baal <luukvbaal@gmail.com>
Tue, 31 May 2022 09:07:31 +0000 (11:07 +0200)
committerLuuk van Baal <luukvbaal@gmail.com>
Tue, 31 May 2022 09:07:31 +0000 (11:07 +0200)
.github/workflows/ci.yml
Makefile
patches/README.md

index 9cafe0dd055e55a52d60b604f20bd56b04aee14b..eba2651970d0363d93da735ca8d0782cbeef9c62 100644 (file)
@@ -43,12 +43,13 @@ jobs:
         env:
           CC: gcc
         run: |
+          export PATCH_OPTS="--merge"
           patches=("O_GITSTATUS" "O_NAMEFIRST" "O_RESTOREPREVIEW")
           z=$(( 1 << ${#patches[@]} ))
           for ((n=1; n < z; ++n)); do
             for ((i=0; i < ${#patches[@]}; ++i)); do
               printf "%s=%d " "${patches[$i]}" "$(( (n & (1 << i)) != 0 ))"
             done | tee "tmp" ; echo
-            make clean
+            make clean -s
             xargs make <"tmp"
           done
index 5b8783f4bd85797478e4a2abfe67ffc392641b00..1c7e0ddbf27e2017f247adcf61eaf926b37f2acd 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -312,28 +312,28 @@ clean:
 
 prepatch:
 ifeq ($(strip $(O_NAMEFIRST)),1)
-       patch --forward --merge --strip=1 --input=$(NAMEFIRST)/mainline.diff
+       patch --forward $(PATCH_OPTS) --strip=1 --input=$(NAMEFIRST)/mainline.diff
 ifeq ($(strip $(O_GITSTATUS)),1)
-       patch --forward --merge --strip=1 --input=$(GITSTATUS)/namefirst.diff
+       patch --forward $(PATCH_OPTS) --strip=1 --input=$(GITSTATUS)/namefirst.diff
 endif
 else ifeq ($(strip $(O_GITSTATUS)),1)
-       patch --forward --merge --strip=1 --input=$(GITSTATUS)/mainline.diff
+       patch --forward $(PATCH_OPTS) --strip=1 --input=$(GITSTATUS)/mainline.diff
 endif
 ifeq ($(strip $(O_RESTOREPREVIEW)),1)
-       patch --forward --merge --strip=1 --input=$(RESTOREPREVIEW)/mainline.diff
+       patch --forward $(PATCH_OPTS) --strip=1 --input=$(RESTOREPREVIEW)/mainline.diff
 endif
 
 postpatch:
 ifeq ($(strip $(O_NAMEFIRST)),1)
 ifeq ($(strip $(O_GITSTATUS)),1)
-       patch --merge --reverse --strip=1 --input=$(GITSTATUS)/namefirst.diff
+       patch --reverse $(PATCH_OPTS) --strip=1 --input=$(GITSTATUS)/namefirst.diff
 endif
-       patch --merge --reverse --strip=1 --input=$(NAMEFIRST)/mainline.diff
+       patch --reverse $(PATCH_OPTS) --strip=1 --input=$(NAMEFIRST)/mainline.diff
 else ifeq ($(strip $(O_GITSTATUS)),1)
-       patch --merge --reverse --strip=1 --input=$(GITSTATUS)/mainline.diff
+       patch --reverse $(PATCH_OPTS) --strip=1 --input=$(GITSTATUS)/mainline.diff
 endif
 ifeq ($(strip $(O_RESTOREPREVIEW)),1)
-       patch --merge --reverse --strip=1 --input=$(RESTOREPREVIEW)/mainline.diff
+       patch --reverse $(PATCH_OPTS) --strip=1 --input=$(RESTOREPREVIEW)/mainline.diff
 endif
 
 skip: ;
index b349065adbede8842557daee724d93879e1b8a29..199213d8f4b777d1aabcc9811d90ad245e867142 100644 (file)
@@ -20,6 +20,6 @@ To apply a patch, use the corresponding make variable, e.g.:
 
 Whenever patch conflicts occur on the latest master, pull requests resolving them are welcome. Let's say a conflict occurs in the `restorepreview` patch. The best way to resolve this conflict would be something along the lines of:
 
-- Ensure you're on latest master and run `cp src/nnn.c src/nnn.c.orig && make O_RESTOREPREVIEW=1`. This will save a copy of the source from master in `src/nnn.c.orig` and generate conflict markers in `src/nnn.c`.
+- Ensure you're on latest master and run `cp src/nnn.c src/nnn.c.orig && PATCH_OPTS="--merge" make O_RESTOREPREVIEW=1`. This will save a copy of the source from master in `src/nnn.c.orig` and generate conflict markers in `src/nnn.c`.
 - Next edit `src.nnn`, resolve all the conflicts around the conflict markers(`<<<<<<<`), and save.
 - Then run `diff -u src/nnn.c.orig src/nnn.c > patch.diff` to generate the new patch file and copy the contents to `patches/restorepreview/mainline.diff` (keeping the description comment at the start of the file).