Issue 1254: Allow for multiple (non-amend) commits
Status:  New
Owner: ----
Reported by zorze...@gmail.com, Feb 7, 2012
Imagine this following scenario:

1. create branch A, work on it, commit, push to gerrit
2. create branch B based on branch A (say you need to work on something that depends on A), work on it, commit
3. get feedback on branch A, switch to branch A, work on it (incorporate code review feedback), commit (amend), push to gerrit
4. switch to branch B, rebase to A

At this point, git will say that all the changes done in #3 conflict and can't be auto-merged, even if branch B's actual work (#2) only touched other files.

This happens because, with the amend, git lost the ability to tell that B's state is simply A's state as per #1, and that A is the same, plus A's changes as per #3. If, instead, A's commit on #3 was _not_ an amend, git would merge with no conflicts.

For this (and other scenarios), it would be useful if gerrit accepted a chain of commits as a single reviewable block, instead of requiring amends to a single commit. It seems to me that the same squashing that the client can do right before a push to gerrit could be done inside of gerrit while it displays the change for review.

Feb 7, 2012
Project Member #1 edwin.ke...@gmail.com
I think, you would have no problem if in step 4 you would rebase only the last commit onto branch B, e.g.
  git checkout A
  git rebase --onto B HEAD~1
Feb 7, 2012
Project Member #2 edwin.ke...@gmail.com
sorry, looks like I mixed A and B in my example
May 15, 2013
#3 dgibso...@gmail.com
There are a ton of other flows that would benefit from this.  In order to work with the current solution, we need to build wrapper scripts to merge or rebase before pushing a review.  The consequences for the history of a branch are a bit disturbing.  I'd really like to see "Review-per-push" as a per-project option.
May 30, 2013
#4 apip...@pippins.net
I second Doug Gibson's remarks. We moved to Gerrit from ReviewBoard, and really miss the ability to review a group of commits as a single review item. Right now, we have to squash merge our commits prior to pushing our changes back to Gerrit, which becomes restrictive in certain scenarios. Having a review tool that allows us to group multiple commits into a single review through a single interface with a single verify/review approval process to accept all commits into the repository would be extremely valuable. 
Nov 14, 2013
#5 heath.bo...@gmail.com
I've just moved from Crucible to gerrit, and I really don't understand why this isn't supported. Constant amending and squashing seems very anti-git, especially if you're working with others.

Is there any documentation that explains the reason for the current behavior? Lots of great projects use gerrit, so I'm sure there's a good reason for it, but I haven't found that yet.
Nov 21, 2014
#6 ryan.sch...@gmail.com
With the "Always Merge" feature the principles of Gerrit can still be maintained, as the diff presented in the web interface would be between it and the target branch.

Would like to know when this can be supported.
Nov 21, 2014
#7 abdulhal...@gmail.com
I like. 
Thanks. 
★★★★★
IMG-20141106-WA0073.jpg
54.1 KB   View   Download
IMG-20141031-WA0027.jpg
43.1 KB   View   Download
2014-02-11 12.59.00-1.png
43.7 KB   View   Download
IMG-20141031-WA0036.jpg
52.7 KB   View   Download
IMG-20141023-WA0047.jpg
30.2 KB   View   Download