Multiple changes in a single project, uploading only one?

2,714 views
Skip to first unread message

Jean-Baptiste Queru

unread,
Jan 20, 2009, 2:56:02 PM1/20/09
to repo-d...@googlegroups.com
I have made a change in one project, repo uploaded it, and I've now
made a second change in the same branch (the second one logically
follows the first one).

repo upload doesn't give me the option of picking only the second
change for upload, as I don't have any change in any other projects. I
only have a yes/no prompt.

Obviously, there's an easy workaround (create a throwaway commit in
some other unrelated project, and repo upload will show me the "full"
UI in which I can choose individual changes), but I figured I'd
mention this.

JBQ

--
Jean-Baptiste M. "JBQ" Queru
Android Engineer, Google.

Shawn Pearce

unread,
Jan 20, 2009, 3:07:42 PM1/20/09
to repo-d...@googlegroups.com
Nope.  You are misunderstanding how "repo upload" works.

You don't upload single changes.  You upload an entire branch.

If you do this sequence of actions:

  repo start foo .
  git commit -a -m A
  repo upload
...
  git commit -a -m B
  repo upload

You'll be prompted to upload both A and B, but you are still on the same branch, foo.  Upload the branch anyway. Gerrit sorts out duplicates and will only create a new change for B.  Unless you've amended A, in which case it will also make a new A, because the SHA-1 hash doesn't match to an existing change in that project.

Under Gerrit2 the upload will be more efficient, as the data for A won't have to be sent up to Gerrit.  Under Gerrit1 the data for A is sent anyway, even though its unnecessary.

Jean-Baptiste Queru

unread,
Jan 20, 2009, 3:55:21 PM1/20/09
to repo-d...@googlegroups.com
OK, that makes sense.

Thanks,
JBQ

Debashish Ghosh

unread,
Feb 2, 2017, 4:33:28 AM2/2/17
to Repo and Gerrit Discussion
I cherry-picked a change A (which is not yet merged), then made some changes and created a commit B.

Now when I try to upload, it shows both the commits A and B.
I believe that it will only push changes from B.
But it is saying "No changes between prior commit d287fb0 (commit ID of A in gerrit) and new commit 4c6869f (commit ID of A in local)". This is preventing commit B to be uploaded.

What to do now?

David Pursehouse

unread,
Feb 3, 2017, 10:43:24 PM2/3/17
to Debashish Ghosh, repo-discuss


On Thu, 2 Feb 2017 18:33 Debashish Ghosh, <debas...@gmail.com> wrote:
I cherry-picked a change A (which is not yet merged), then made some changes and created a commit B.

If you cherry-pick a change its committer is changed to your identity, and git will push it.


Now when I try to upload, it shows both the commits A and B.
I believe that it will only push changes from B.
But it is saying "No changes between prior commit d287fb0 (commit ID of A in gerrit) and new commit 4c6869f (commit ID of A in local)". This is preventing commit B to be uploaded.

Gerrit, by design, refuses to create a new patch set when only the committer is changed 

What to do now?

Use checkout instead of cherry-pick to get the first commit.  This will not change the committer name, and then git will not try to push it.

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages