New issue
Advanced search Search tips

Issue 674254 link

Starred by 1 user

Issue metadata

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


Previous locations:
gerrit:5136


Sign in to add a comment

`git cl upload` ignores -t flag with gerrit

Project Member Reported by thakis@chromium.org, Dec 13 2016

Issue description

I committed a bunch of stuff to a branch and then ran `git cl upload -t "Do some stuff"`, expecting "Do some stuff" to appear in $EDITOR. Instead, $EDITOR only contained the commit messages of my local commits and it ignored the -t parameter.
 
Project: chromium
Moved issue gerrit:5136 to now be  issue chromium:674254 .
Components: Infra>Codereview>Gerrit
Labels: -Hotlist-Chromium Milestone-Dogfood Proj-Gerrit-Migration Pri-2 Type-Bug
Owner: aga...@chromium.org
Status: Assigned (was: New)
Status: Started (was: Assigned)
So the rietveld behavior is this:
* If you're creating a new issue and don't specify a message, it defaults to title (if specified) plus recent commit history (and opens an editor to confirm)
* If you don't specify a title, it defaults to first line of message
* If you don't specify that, it defaults to the first line of the most recent commit (and prompts to confirm)
* If you don't specify a message, the message becomes the same as the title
* If you're creating a new issue:
  * title becomes the issue title
  * message becomes the issue commit message
  * whitespace becomes the patchset description
* If you're uploading a new patchset to an existing issue:
  * title becomes the patchset description
  * message becomes the body of the email message

The gerrit behavior is close but not quite the same. It is:
* If you're creating a new issue:
  * if you don't specify a message, it defaults to recent commit history (and opens an editor to confirm)
  * if you don't specify a title, it defaults to 'Initial upload'
  * message becomes the commit description
  * first line of message becomes the CL title
  * title becomes the patchset description
* If you're uploading a patchset to an existing issue:
  * if you don't specify a title, it defaults to the first line of the most recent commit message (and prompts to confirm)
  * title becomes the patchset description
  * message is ignored

So the things that need to be fixed are:
* Gerrit needs to prepend title to message before opening an editor to confirm
* If you specify a message for non-initial upload, it should send an email

Here's a CL for the former: https://chromium-review.googlesource.com/425823
And I'm not going to fix the latter because few people use it and gerrit doesn't support it anyway.
Project Member

Comment 4 by bugdroid1@chromium.org, Jan 11 2017

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

commit b56ad33d008b7589b20f853c3126d89760a4e508
Author: Aaron Gable <agable@chromium.org>
Date: Fri Jan 06 23:24:31 2017

Respect -t/--title in initial cl uploads to Gerrit

BUG= 674254 

Change-Id: Icdc572648dfffeca7e28f327e085f64985221ce9
Reviewed-on: https://chromium-review.googlesource.com/425823
Commit-Queue: Aaron Gable <agable@chromium.org>
Reviewed-by: Andrii Shyshkalov <tandrii@chromium.org>

[modify] https://crrev.com/b56ad33d008b7589b20f853c3126d89760a4e508/git_cl.py
[modify] https://crrev.com/b56ad33d008b7589b20f853c3126d89760a4e508/tests/git_cl_test.py

Comment 5 by aga...@chromium.org, Jan 11 2017

Status: Fixed (was: Started)

Sign in to add a comment