Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Copilot Lvl 2
Message 1 of 7

Broken ordering of commits in PRs

We just realised that commits in a pull requests are visualized in the chronological order of their creation, rather than their actual commit order in the branch that should be merged. See

    https://github.com/siemens/meta-iot2000/pull/102/commits vs.

    https://github.com/andi8086/meta-iot2000/commits/integration7.

 

I'm a bit surprised to find such a fundamently issue in this prominent feature - or is this a recent regression of the UI?

6 Replies
Commander Lvl 3
Message 2 of 7

Re: Broken ordering of commits in PRs

The order of creation === the order of how they should be merged? Or am I seeing something wrong here?


- Mark
Copilot Lvl 2
Message 3 of 7

Re: Broken ordering of commits in PRs

When merging a branch, the actual order in that branch defines the merging order. That may differ (like in this case) from the creation order of a commit if you used git rebase on that branch prior to publishing it. That's in fact a pretty common workflow when designing clean patch queues in a logical (rather than just chronological) order.

Copilot Lvl 2
Message 4 of 7

Re: Broken ordering of commits in PRs

It also has been hapenning to me for at least a few days. Fixing up old commits makes the visual order in github wrong. Hope this problem resolves soon.

Ground Controller Lvl 1
Message 5 of 7

Re: Broken ordering of commits in PRs

I've ran into this issue a number of times.  It's quite frustrating to organize a large change into a sequence of small logical steps only to have those steps displayed in the wrong order on the PR.  Any chance of this getting addressed by github?

Copilot Lvl 2
Message 6 of 7

Re: Broken ordering of commits in PRs

I agree that the actual tree structure is more important than the timestamp of the commits, it's possible to change the commit date doing rebases, corrections and cherry-picks, but they should follow the tree structure and not a timestamp flow.

It's really sad when rewriting your commit history via git rebase or a force push in a PR, to notice that your commit sequence is out of order, its really hard for us as developers to follow timestamp flow to review commits, seriously! Every time that I try to review commits out of order I lost part of my hair soul.

Is this a bug or a really weird feature ?

 

github:

image.png

 

tig:

 

image.png

Ground Controller Lvl 1
Message 7 of 7

Re: Broken ordering of commits in PRs

Yes, I was surprised that BitBucket does better in that respect - not only ordering the commits, but also representing the commits as a graph. Have a look at https://bitbucket.org/ignitionrobotics/ign-math/commits/ as an example.