fonsdant commented on PR #17204:
URL: https://github.com/apache/kafka/pull/17204#issuecomment-2369905530

   @mumrah, forgive me if I am being too repetitive or slow to develop. I am 
trying to achieve a great result to us and Kafka contributors.
   
   I was afraid to proceed with merge approach as it have needed to use 
`--allow-unrelated-histories`  on my personal repo tests. But I have been 
afraid to proceed with ref approach too as I have noted that it is somehow 
"hided" from the git user, for example: when `git log` show tags and branches 
(local and remote), but not see the cached ref I have created.
   
   So, I have decided to put a little more effort on branch approach, then I 
have found this PR: (fatal: refusing to merge unrelated 
histories)[https://github.com/actions/checkout/issues/125]. This explains why I 
am getting ["fatal: refusing to merge unrelated 
histories"](https://github.com/fonsdant/github-actions/actions/runs/11004390641/job/30555214700#step:3:28)
 and now ["fatal: Not possible to fast-forward, 
aborting"](https://github.com/fonsdant/github-actions/actions/runs/11004489567/job/30555506559#step:3:37).
   
   According to [GitHub Checkout Action 
docs](https://github.com/marketplace/actions/checkout#Checkout-a-different-branch):
 _Only a single commit is fetched by default, for the ref/SHA that triggered 
the workflow._ As trunk is tringgering the workflow, only its head is fetched. 
I have achieved to fetch all trunk-based, but trunk no (even with `git fetch`). 
You can check the test on my personal repo: 
[here](https://github.com/fonsdant/github-actions/actions/runs/11004780392/job/30556346504#step:3:19).
 It's a problem for us to achieve our goal since...
   
   ```
   old stuff -> A (cached) -> B -> C -> D -> HEAD
   ```
   
   ... we are going to lose B and C, and only merging D (latest commit fetched 
by checkout action.
   
   I have made a test reversing the branches and setting trunk-cached as ref to 
checkout action. Therefore, the trunk history may be fetched and merged into 
trunk-cached (now, the one having only the latest commit fetched by checout 
action). This works as expected! See 
[here](https://github.com/fonsdant/github-actions/actions/runs/11005038170/job/30557041260)
 and 
[here](https://github.com/fonsdant/github-actions/actions/runs/11004838601/job/30556492241).
   
   WDYT? :D


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to