Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix rebase when changeIDs are missing
Context --- When git-review is run a first time when the git hook is not installed, maiao wil do 2 things: 1. suggest to install the git hook 2. perform a rebase so all commits are updated with a changeID When establishing the list of commits, maiao walks through the log, from the most recent to the oldest, starting from the repo HEAD and ending with the remote HEAD. Those commits are then added to the changes in the same order so they can be used in the rebase TODO list in the relevant order. Problem --- The technique used to inject the changes differs whether there is a changeID or not in the commit message. If a changeID is present, the commit is added at the beginning of the change list, ensuring an order from oldest to newest. If now, the change ID is absent, the commit is added at the end of the list, making an order from newest to oldest. Concretely, if the local changes are: * $sha1 A commit without changeID 1 * $sha2 A commit with a changeID 1 * $sha3 A commit without changeID 2 * $sha4 A commit with a changeID 2 They will bet rebased as following, which may cause rebase conflicts on the way. * $sha1 A commit without changeID 1 * $sha3 A commit without changeID 2 * $sha2 A commit with a changeID 1 * $sha4 A commit with a changeID 2 Goal --- Fix this situation Change-Id: Id8ee8c9a86ba7081bddc123a31adbca382445582
- Loading branch information