New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 682104 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

Regression: Could not upload branch to codereview with local master

Project Member Reported by calamity@chromium.org, Jan 18 2017

Issue description

My tree structurefor depot_tools is as below:

origin/master
  master
    some_fix *  [ ahead 1 ]

I tried to upload some_fix but got:

Upload upstream branch master first.
It is likely that this branch has been rebased since its last upload, so you just need to upload it again.
(If you uploaded it with --no-squash, then branch dependencies are not supported, and you should reupload with --squash.)

It was necessary for me to set some_fix's upstream to origin/master for me to upload. I don't think the requirement that the upstream branch be uploaded is too useful. It breaks the local master workflow, and I sometimes make little hack-branches (remove an unrelated DCHECK firing too often) that I base real work branches off.
 
Owner: ----
removing myself as owner so this is properly triaged.
Cc: tandrii@chromium.org
Components: -Infra>Codereview Infra>Codereview>Gerrit
Labels: Milestone-Dogfood Proj-Gerrit-Migration
Owner: aga...@chromium.org
Status: Assigned (was: Untriaged)

Comment 3 by aga...@chromium.org, Jan 20 2017

Cc: -tandrii@chromium.org aga...@chromium.org
Owner: tandrii@chromium.org
This is effectively a duplicate of  issue 649846 . Both of these are saying "we need a way to upload a diff other than an actual branch tracking a branch which has already been uploaded".

I expect that they'll be implemented via the same code path. Something that can take in a list of commit hashes (generated either via "git log <diff args>" or "git log @{u}" as requested in this bug) and rebase/cherry-pick them on top of origin/master before upload.

Since tandrii@ owns that one, assigning this one to him as well. tandrii@: might be worth filing a bug for tracking the implementation detail work for generating the shadow commit, and marking it as blocking both of these.

Comment 4 by mgiuca@chromium.org, Jan 22 2017

Summary: Regression (polygerrit): Could not upload branch to codereview with local master (was: Could not upload branch to codereview with local master)
I think it's important to track this as a separate bug. Note that  Issue 649846  is a long-standing issue with git cl upload for people who want to specify extra arguments.

Although calamity@ didn't explicitly state it, this is a *regression* for PolyGerrit. Uploading with a non-uploaded upstream works perfectly fine with a Reitveld server (and I assume many people -- at least the two of us for starters -- rely on this workflow). Updated the title to reflect that this is a regression. This should be a blocker for switching the main Chromium repo to PolyGerrit.
Summary: Regression: Could not upload branch to codereview with local master (was: Regression (polygerrit): Could not upload branch to codereview with local master)
We are tracking it as separate bug, that's why we didn't dedup it. I intend to start working on this bug by end of next week.

Comment 6 by aga...@chromium.org, Jan 23 2017

Yes, and note that both this bug and the other bug are marked as blocking the migration itself (they're in Milestone-Dogfood and Milestone-Launch, respectively).

We definitely recognize that these are real issues and real regressions.
Status: Started (was: Assigned)
> tandrii@: might be worth filing a bug for tracking the implementation detail work for generating the shadow commit, and marking it as blocking both of these.

git cl already creates shadow commit, but on top of incorrect parent (effectively hardcoded as upstream, which is either shadow commit of local branch OR remote's branch that is being tracked).

Comment 8 by aga...@chromium.org, Jan 25 2017

Right, I meant to track the work of generating the shadow commit with variable args. Then the current code could just say "diff against upstream, on top of upstream", resolving this bug could say "diff against upstream, on top of origin/master", and resolving  issue 649846  could say "diff with args, against origin/master".

Comment 9 by aga...@chromium.org, Mar 28 2017

tandrii@: this says "Started". Do you have a CL where you've started work on making gerrit git-cl upload agnostic of master? It would be really nice to solve this in the next couple days before dogfood and I thought this had been solved but I'm not sure of the actual state here.
Project Member

Comment 10 by bugdroid1@chromium.org, Mar 30 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/tools/depot_tools/+/f97e33d27f2d0522c7c200fdc80d0129fb3d6437

commit f97e33d27f2d0522c7c200fdc80d0129fb3d6437
Author: Aaron Gable <agable@chromium.org>
Date: Thu Mar 30 22:49:03 2017

Gerrit git-cl: special-case branches tracking 'master'

This is a hack to support the most common git workflow: keeping
a local branch named 'master' which is a replica of 'origin/master'
with no local changes, and basing all feature branches off of
that.

Test:
* created master branch, created feature branch, uploaded CL correctly
* created master branch, landed change on master branch, created
  feature branch, uploaded CL, CL contains change on master too
* created non-master branch, created feature branch, failed to
  upload CL

Bug:  682104 
Change-Id: I8481b787e6dcab162d2846c07f1ddad950f491e0
Reviewed-on: https://chromium-review.googlesource.com/464107
Reviewed-by: Andrew Bonventre <andybons@google.com>
Commit-Queue: Aaron Gable <agable@chromium.org>

[modify] https://crrev.com/f97e33d27f2d0522c7c200fdc80d0129fb3d6437/git_cl.py

Cc: tandrii@chromium.org
Owner: aga...@chromium.org
Status: Fixed (was: Started)
I've fixed this by special-casing 'master' when computing the upstream here: https://chromium-review.googlesource.com/c/464107/

It's not the way I'd like to do this (I'd like to do it as described in comment 3), but this does resolve the issue at hand. I'll leave the better implementation of supporting full git-diff args to tandrii in the Launch milestone.

Sign in to add a comment