A question about git cl upload

735 views
Skip to first unread message

Dean Liao

unread,
Jul 25, 2018, 9:55:43 PM7/25/18
to Chromium-dev
I recently encountered an issue about git cl upload. I originally had two commits:

However, after https://chromium-review.googlesource.com/c/chromium/src/+/1143122 was merged, I cannot use "git cl upload" to update patchset for the latter commit. It said:
Change https://chromium-review.googlesource.com/1114568 has been submitted, new uploads are not allowed

I check git cl status:

However, git show listed the review-in-progress commit (1122022) is still on the top:
4a87b165c977 (HEAD -> video_frame) media: Use VideoFrameLayout to encapsulate fields in VideoFrame
ce0157f4edc1 (origin/master, origin/HEAD) Cleanup IsArcAppWindow() in ArcWindowDelegateImpl.
...

Does anyone know how to update git cl memory?

Best,
Dean

Peter Boström

unread,
Jul 25, 2018, 10:01:26 PM7/25/18
to dean...@google.com, Chromium-dev
You can use git cl issue to see which issue your branch is currently assigned to, and use git cl issue 0 to clear it (or put something else to set it).

--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
---
You received this message because you are subscribed to the Google Groups "Chromium-dev" group.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-dev/47d47e09-f42c-4d45-a2bd-973ce8d4b540%40chromium.org.

Dean Liao

unread,
Jul 26, 2018, 2:19:55 AM7/26/18
to Chromium-dev, dean...@google.com
I see. Thank you!

For a branch of multiple commits, what commit should git cl issue point to? The first/earliest one or the last/top one?


Peter Boström於 2018年7月26日星期四 UTC+8上午10時01分26秒寫道:

Jan Wilken Dörrie

unread,
Jul 26, 2018, 2:24:02 PM7/26/18
to dean...@google.com, Chromium-dev
You should point your local branches to the corresponding Gerrit issue ids. Normally this is taken care of for you when you create a new branch. Then the first git cl upload will create a new Gerrit issue and remember its id. As Peter said, you can use `git cl issue` to query your current id. `git cl issue $ID` will set the id to $ID, where 0 has a special meaning. 

In your particular case it looks like your branch pointed to https://crrev.com/c/1114568, while you wanted to point it to https://crrev.com/c/1122022. Checking out the video_frame branch and running `git cl issue 1122022` likely should have fixed the issue for you.

--

Jan Wilken Dörrie

Software Engineer

jdoe...@google.com
 +49 89 839300973


Google Germany GmbH

Erika-Mann-Straße 33

80636 München


Geschäftsführer: Paul Manicle, Halimah DeLaine Prado

Registergericht und -nummer: Hamburg, HRB 86891

Sitz der Gesellschaft: Hamburg


Diese E-Mail ist vertraulich. Falls sie diese fälschlicherweise erhalten haben sollten, leiten Sie diese bitte nicht an jemand anderes weiter, löschen Sie alle Kopien und Anhänge davon und lassen Sie mich bitte wissen, dass die E-Mail an die falsche Person gesendet wurde.

    

This e-mail is confidential. If you received this communication by mistake, please don't forward it to anyone else, please erase all copies and attachments, and please let me know that it has gone to the wrong person.

Peter Boström

unread,
Jul 26, 2018, 2:30:30 PM7/26/18
to jdoe...@chromium.org, Dean Liao, Chromium-dev
I suspect your local state confusion might be due to trying to reuse previous branches (that have the old CL issue attached to them). If that's the case I suggest that you check out and track the master branch (git checkout origin/master && git checkout -b master) if you don't have one.  You can remove old branches by calling "git branch -D old_branch", just make sure you don't have any uncommitted changes on them or you'll have data loss.

You can update that branch by running git pull, and create new branches from it by calling git checkout -b new_branch (when you have master checked out already). Unless you have an ongoing change I don't think your git cl issue should point to anything. When you're done with your new patch, git cl upload will generate a new ID for you. This ID should pretty much only be used for a single change and not reused in future branches.

There might be a better workflow (git new-branch and git rebase-update are related commands that some folks use that take care of deleting old branches for you).

Hope that makes sense,
- Peter

Reply all
Reply to author
Forward
0 new messages