-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
patching: rewrite: fully stabilize patch index
stanzas as well as From lines
#6623
patching: rewrite: fully stabilize patch index
stanzas as well as From lines
#6623
Conversation
We've a few malformed patches here and there, which are being handled by other people -- due to this I'm holding back a batch of rewrites of the "big 5" kernels edge patches using this implementation for a while. |
f3451c5
to
db756b6
Compare
2f46115
to
842d436
Compare
Not quite directly related, but I have discovered that patches created with Example: Patch created with @@ -400,11 +400,11 @@ $(obj)/%.dtb.S: $(obj)/%.dtb FORCE
$(obj)/%.dtbo.S: $(obj)/%.dtbo FORCE
$(call if_changed,wrap_S_dtb)
quiet_cmd_dtc = DTC $@
cmd_dtc = $(HOSTCC) -E $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
- $(DTC) -o $@ -b 0 \
+ $(DTC) -@ -o $@ -b 0 \
$(addprefix -i,$(dir $<) $(DTC_INCLUDE)) $(DTC_FLAGS) \
-d $(depfile).dtc.tmp $(dtc-tmp) ; \
cat $(depfile).pre.tmp $(depfile).dtc.tmp > $(depfile)
quiet_cmd_fdtoverlay = DTOVL $@ After doing @@ -402,7 +402,7 @@ $(obj)/%.dtbo.S: $(obj)/%.dtbo FORCE
quiet_cmd_dtc = DTC $@
cmd_dtc = $(HOSTCC) -E $(dtc_cpp_flags) -x assembler-with-cpp -o $(dtc-tmp) $< ; \
- $(DTC) -o $@ -b 0 \
+ $(DTC) -@ -o $@ -b 0 \
$(addprefix -i,$(dir $<) $(DTC_INCLUDE)) $(DTC_FLAGS) \
-d $(depfile).dtc.tmp $(dtc-tmp) ; \
cat $(depfile).pre.tmp $(depfile).dtc.tmp > $(depfile) BUG: Maybe I should open an issue about this 😄 |
Yes, because https://github.com/armbian/build/blob/main/lib/functions/compilation/patch/patching.sh#L121 ( Should be easy to fix, eg, make them equal -- but really, what is better, 5 or 3, I dunno.
I can't follow; tired eyes. Did this alledged bug happen with this PR or is it on |
5 is better because more context 👍 This way when rewriting patches, it won't remove lines but will also not be able to add new lines I believe (or can it since it can see the context? that would be nice, although would cause lots of commit diff).
Apologies, I discovered it in main without this PR applied. |
…rom lines - `git format-patch --zero-commit` doesn't affect `index xxx...yyy` lines, only `From: ` - so use the _classy_ "use a regex with a callback" solution as git format-patch doesn't offer one - this will make _all_ patches change when rewritten, but hopefully _for the last time_ ! - we need to preserve `index 000000000000..xxx` as zeros, which indicate new file creation, thus: - new file creations are rewritten as `index 000000000000..111111111111` - non-creations are rewritten as `index 111111111111..222222222222` - this is the final version of armbian#6455
842d436
to
4894ceb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to work as it should.
Maybe the regex magic could have been avoided using git diff --no-index
instead when creating or rewriting patches, but at this point I think your solution is totally fine as well 👍
Hmm. Is there a |
I don't think so, but actually I think I finally found out how! Try using the environmental variable: |
Oh wow. Will check this out soon, as it's high-hackage but better than regex-replacing index stanzas! Thanks for sharing |
patching: rewrite: fully stabilize patch
index
stanzas as well as From linesindex
stanzas as well as From linesgit format-patch --zero-commit
doesn't affectindex xxx...yyy
lines, onlyFrom:
index 000000000000..xxx
as zeros, which indicate new file creation, thus:index 000000000000..111111111111
index 111111111111..222222222222
index
stanzas as well as From lines #6455