chore: avoid squashing patch files into a single file#12772
chore: avoid squashing patch files into a single file#12772TomAFrench wants to merge 3 commits intonextfrom
Conversation
| # to push the branch without the fixup commit. In that case we'd need to do a fresh | ||
| # checkout to re-apply the fixup and the patches. | ||
| if [ $have == true ] && has_fixup_and_patch; then | ||
| if [ $have == true ] && has_patch_commit; then |
There was a problem hiding this comment.
We can probably avoid the empty patch commit by just searching for the commit message in the last patch file.
There was a problem hiding this comment.
We don't necessarily have to have a patch file, right? I think the empty commit is easy to understand, and easy to see that it finished doing it without having to look into the patches directory when you're just looking at the git log.
There was a problem hiding this comment.
Another reason is that it makes it easy to see which commit is the first one that I added on top of the local patches, when I want to rebase my feature branch.
| fixup=$(find_fixup_commit) | ||
| [ -z "$fixup" ] && return 1 | ||
| git -C noir-repo rev-parse "$fixup~1" | ||
| git -C noir-repo rev-list -n 1 $(read_wanted_ref) |
There was a problem hiding this comment.
What does this command do exactly?
There was a problem hiding this comment.
It looks like if I invoke it with a branch name it gives me the last commit of that branch. What if I'm on a feature branch, like when I was working on af/msgpack-codegen, and have the following commits in my history: origin/af/msgpack-codegen; patch1; patch2; patch-marker; commit1; commit2. Wouldn't it return commit2?
There was a problem hiding this comment.
From git rev-list --help
List commits that are reachable by following the parent links from the given commit(s)
I'm limiting this command to only return 1 commit hash so it will always return the commit hash which the tag returned from $(read_wanted_ref)` resolves to.
There was a problem hiding this comment.
I'm using this as a method so that I can unify branches/tags/commit hashes/etc into a commit hash.
Having a single monolithic patch file discourages us from breaking patches down into self-contained units which we can then easily send back to the main noir repo and then remove again.
This PR replaces
noir-repo.patchwith thepatchesdirectory. As a bonus I've completely removed the fixup script as after #12771 it can be replaced with a simple patch.