Hi Uv:

regarding https://lists.apache.org/thread/l8hgqwkm9vt8yhygoo2blw5j4n5gh121

Would it be possible for Crave, instead of using `git format-patch` /
`git am`, to instead generate/apply a simple single diff/patch, via
`git diff <merge-base>..<pr_head> > file.patch` / `git apply
file.patch`?

This would address a couple of problems, and should be more efficient
on IO as well (which is I gather the motivation for the patch-based
approach in the first place).

In some cases (e.g., https://github.com/apache/solr/pull/1351), Crave
fails to apply patches even when the source PR branch is completely
up-to-date (has merged in the latest commit from `main`). The
workaround of rebasing is not ideal, in that it necessitates
force-pushes, which are considered an anti-pattern in some contexts,
and can generally be an inconvenience for transparency and
collaborative development.

But separately relevant: Crave doesn't care about the commit history
-- it's only using patches to optimize IO bandwidth. So generating a
single diff between the merge-base and the PR head should iiuc be
exactly what you want, and would be guaranteed to always apply
cleanly.

Would you mind sharing how you're deriving the "merge-base" commit,
and the command you're using (I assume, `git format-patch`?) to
generate the patch files? Having just merged `main` into a PR branch,
the merge-base of the PR branch and `main` should be: `main`.

Thank you for your consideration!
Michael

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@solr.apache.org
For additional commands, e-mail: dev-h...@solr.apache.org

Reply via email to