One of my teams will periodically see an activity update in their pull requests that is something like:
Updated pull request by removing 2 commits
This is followed by the list of commits that have been removed. In the case that I'm looking at, the team member does not know what they did to remove the commits.
Anyone have any ideas how this might happen?
Any history rewrite will do that. E.g., "git rebase" or "git commit --amend" or "git merge --squash" followed by a "git push --force".
No work is lost. It's just that old commits are being replaced with new commits after a rebase.
Also, if you're only seeing "Updated pull request by removing 2 commits" and never seeing newer entries of "Updated pull request by adding X commit(s)", that corresponds to someone doing something like "git reset --hard HEAD~2" and "git push --force" - in other words, backing out some changes through a history rewrite.
The rebase or squash cases are the most typical for seeing activity like this.
I suspect it happened as a result of a change to the target branch. Consider this example:
c1 --- c2 --- c3 <--- master
--- c4 <--- feature/A
--- c5 <-- feature/B
In this example, master is at commit c3, feature/A is at c4 and feature/B is at c5. Suppose you have 2 pull requests:
When PR1 is merged, the commit graph looks like this:
c1 --- c2 --- c3 --- c6 <--- master
--- c4 ---
--- c5 <-- feature/B
commit c4 is now 'on' master because it's in master's ancestry. At this point, PR2 would no longer introduce c4 on master because it's already there. Merging PR1 has changed the 'scope' of what PR2 would add to the target branch.
Note that this is not the only possible scenario. Other options are:
Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda ...
Connect with like-minded Atlassian users at free events near you!Find a group
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no AUG chapters near you at the moment.Start an AUG
You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs
We're bringing product updates and pro tips on teamwork to ten cities around the world.Save your spot