I learned that git has notion of different file states: 1. New 2. Modified 3. Staged 4. Committed
After searching a lot, what I have found is if I want to send for code review to any tool, I have to make commit to local repository and push it to some central repo set for code review (by any code review tool e.g. Gerrit).
Now, suppose file was in state A before starting code review process and it went through 10 more reviews rework i.e. 10 more modifications i.e. 10 more commits to local repository and finally file is in state B, which should finally be committed.
From state A to B 10 commits were done.
Assume of these 10, 4 commits were on same section / part of file.
So, finally, when I will push reviewed and accepted file's final state B to main central repository I will have to make 10 commits of which some intermediate commits took rework i.e. unwanted commits.
But I don't want those unwanted commits.
From what I can think is I am interested in final state B to be pushed to repository with only one commit.
So I am looking for any such approach / tool which allows git staged changes to be sent for reviewed. Reviewer will review. If he rejects and suggest some changes then I unstage previous changes. Apply suggested changes, stage those changes and again sent for review.
Thus finally when code reviewed accepts I will make single commit my staged changes and will need only single final push.