Skip to content

Patching and Updating

Eric Kilmer edited this page Apr 3, 2023 · 3 revisions

TODO. These are rough notes for now.

Rebasing patches

In Ghidra repo directory with updated repo

new_sha=abcdef123
git checkout ${new_sha}
git checkout -b rebasing

# Go through patches from this repo `HEAD` directory one at a time until getting to
# automated patches. Fix any conflicts.
git am -3 <normal patches>

# Automated patches should still try to apply but we will reset everything.
# Trying to apply makes it easier to keep commit info like author and message
git am -3 <automated_patch>
git restore --staged .
git restore .
# Now we run the tool on a fresh set of files
<tool>
git add <changed files>
# Commit with same message
git am --continue

# Continue applying manual patches as before, and fix any conflicts.
git am -3 <normal patches>

# Rewrite patches
git format-patch -o <path_to>/sleigh/src/patches/HEAD ${new_sha}..HEAD

Also see https://github.com/lifting-bits/sleigh/pull/167 for some explanation, particularly this comment https://github.com/lifting-bits/sleigh/pull/167#issuecomment-1479765517

Showing decompiler commits between bumps

git log --no-merges <old>..<new> -- Ghidra/Features/Decompiler/src/decompile Ghidra/Processors

where old is the older commit and new is the newer commit. We also skip merge commits (--no-merges) because they can be noisy. We also limit git to only look at the paths that affect the decompiler (paths after --).

Clone this wiki locally