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

Issue 611020 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Aug 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug



Sign in to add a comment

`git cl issue #issue_num` and `git cl patch 1234` trigger TypeError

Reported by hs1217....@gmail.com, May 11 2016

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.94 Safari/537.36

Steps to reproduce the problem:
1. git cl issue #issue_num

What is the expected behavior?
i want to see "Issue number: #issue_number (https://codereview.chromium.org/#issue_number)"

What went wrong?
$ git cl issue #issue_num
Traceback (most recent call last):
  File "/home/hwanseung/chromium/depot_tools/git_cl.py", line 4907, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/home/hwanseung/chromium/depot_tools/git_cl.py", line 4889, in main
    return dispatcher.execute(OptionParser(), argv)
  File "/home/hwanseung/chromium/depot_tools/subcommand.py", line 252, in execute
    return command(parser, args[1:])
  File "/home/hwanseung/chromium/depot_tools/git_cl.py", line 3240, in CMDissue
    cl.SetIssue(issue)
  File "/home/hwanseung/chromium/depot_tools/git_cl.py", line 1257, in SetIssue
    RunGit(['config', codereview_setting, codereview_server])
  File "/home/hwanseung/chromium/depot_tools/git_cl.py", line 113, in RunGit
    return RunCommand(['git'] + args, **kwargs)
  File "/home/hwanseung/chromium/depot_tools/git_cl.py", line 101, in RunCommand
    return subprocess2.check_output(args, shell=shell, **kwargs)
  File "/home/hwanseung/chromium/depot_tools/subprocess2.py", line 524, in check_output
    return check_call_out(args, stdout=PIPE, **kwargs)[0]
  File "/home/hwanseung/chromium/depot_tools/subprocess2.py", line 484, in check_call_out
    out, returncode = communicate(args, **kwargs)
  File "/home/hwanseung/chromium/depot_tools/subprocess2.py", line 458, in communicate
    proc = Popen(args, **kwargs)
  File "/home/hwanseung/chromium/depot_tools/subprocess2.py", line 210, in __init__
    tmp_str = ' '.join(args)
TypeError: sequence item 2: expected string, NoneType found

Did this work before? N/A 

Chrome version: 50.0.2661.94  Channel: stable
OS Version: 
Flash Version: Shockwave Flash 21.0 r0
 

Comment 1 Deleted

Components: -Platform>DevTools Infra>Git
Retagging as a git client issue since this isn't related to the DevTools functionality.

Comment 3 by smut@chromium.org, May 11 2016

Owner: smut@chromium.org
Status: WontFix (was: Unconfirmed)
Usage is:
$ git cl issue # displays the issue number associated with the current work branch
$ git cl issue x # associates issue x with the current work branch
$ git cl issue 0 # breaks any association between the current work branch and an issue number

Although for the record, if I run "git cl issue #issue_number" I don't get any errors:
$ git cl issue #issue_num
Issue number: None (None)

Is your depot_tools up to date?
Status: Untriaged (was: WontFix)
Summary: `git cl issue #issue_num` and `git cl patch 1234` trigger TypeError (was: git cl issue #issue_num -> python error)
I just encountered this with `git cl patch 2090753002`. Running the exact same command again (arrow up + enter) got a bit further but then failed to commit after auto-resolving conflicts.

(By the way, I don't think OP's usage itself was problematic; either #1234 is interpreted as a comment, or the program should output "Pass a number to set the issue or none to list it.")


~/dev/c/tot/src % git checkout origin/master
Note: checking out 'origin/master'.

You are in 'detached HEAD' state. You can look around, make experimental (blah blah blah....)
HEAD is now at 2a0e012... WebGL2 CTS: remove suppression of linkage.html
~/dev/c/tot/src % git cl patch 2090753002
Traceback (most recent call last):
  File "/usr/local/google/home/michaelpg/tools/depot_tools/git_cl.py", line 5110, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/usr/local/google/home/michaelpg/tools/depot_tools/git_cl.py", line 5092, in main
    return dispatcher.execute(OptionParser(), argv)
  File "/usr/local/google/home/michaelpg/tools/depot_tools/subcommand.py", line 252, in execute
    return command(parser, args[1:])
  File "/usr/local/google/home/michaelpg/tools/depot_tools/git_cl.py", line 4355, in CMDpatch
    options.directory)
  File "/usr/local/google/home/michaelpg/tools/depot_tools/git_cl.py", line 1360, in CMDPatchIssue
    parsed_issue_arg, reject, nocommit, directory)
  File "/usr/local/google/home/michaelpg/tools/depot_tools/git_cl.py", line 1872, in CMDPatchWithParsedIssue
    self.SetIssue(self.GetIssue())
  File "/usr/local/google/home/michaelpg/tools/depot_tools/git_cl.py", line 1273, in SetIssue
    RunGit(['config', codereview_setting, codereview_server])
  File "/usr/local/google/home/michaelpg/tools/depot_tools/git_cl.py", line 113, in RunGit
    return RunCommand(['git'] + args, **kwargs)
  File "/usr/local/google/home/michaelpg/tools/depot_tools/git_cl.py", line 101, in RunCommand
    return subprocess2.check_output(args, shell=shell, **kwargs)
  File "/usr/local/google/home/michaelpg/tools/depot_tools/subprocess2.py", line 524, in check_output
    return check_call_out(args, stdout=PIPE, **kwargs)[0]
  File "/usr/local/google/home/michaelpg/tools/depot_tools/subprocess2.py", line 484, in check_call_out
    out, returncode = communicate(args, **kwargs)
  File "/usr/local/google/home/michaelpg/tools/depot_tools/subprocess2.py", line 458, in communicate
    proc = Popen(args, **kwargs)
  File "/usr/local/google/home/michaelpg/tools/depot_tools/subprocess2.py", line 210, in __init__
    tmp_str = ' '.join(args)
TypeError: sequence item 2: expected string, NoneType found
~/dev/c/tot/src %                        
~/dev/c/tot/src % git cl patch 2090753002
error: patch failed: chrome/browser/resources/settings/settings_main/settings_main.html:60
Falling back to three-way merge...
Applied patch to 'chrome/browser/resources/settings/settings_main/settings_main.html' cleanly.
error: patch failed: chrome/browser/resources/settings/settings_main/settings_main.js:138
Falling back to three-way merge...
Applied patch to 'chrome/browser/resources/settings/settings_main/settings_main.js' cleanly.
Command "git commit -m [MD settings] end of page padding in content area

[Rest of the CL description here.......]

patch from issue 2090753002 at patchset 140001 (http://crrev.com/2090753002#ps140001)" failed.
# HEAD detached from origin/master
nothing to commit, working directory clean


Comment 5 by smut@chromium.org, Jul 21 2016

Cc: smut@chromium.org
Labels: Infra-DX
Owner: ----
+Infra-DX for developer experience of depot_tools/git_cl. Please triage.
Cc: tandrii@chromium.org
Components: -Infra>Git Infra>SDK
Labels: -Via-Wizard -Infra-DX Proj-Gerrit-Migration
Owner: tandrii@chromium.org
Status: Started (was: Untriaged)
I wish you've told me this earlier. This is clearly one of my changes this spring to enable Gerrit support.
So, I think the way to repro this is to have no branch (ie detached HEAD) at the time you ran this command. So, I'm refactoring git cl to get rid of this once and for all :D
Horror CL is here: https://codereview.chromium.org/2259043002
Once that ([lands, gets reverted] * N + [lands]), I should be able to repro this bug with preferably earlier assertion failure.
And actual reason for the exception is now clear: you are on a detached HEAD. This CL bails out in advance and hints to use -b to create a named branch for this: https://codereview.chromium.org/2259993002
Project Member

Comment 10 by bugdroid1@chromium.org, Aug 18 2016

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

commit df09a46d7cec6d4a523a0bb7d740d70b3ac7c663
Author: tandrii <tandrii@chromium.org>
Date: Thu Aug 18 23:23:55 2016

git cl patch: bail out quickly if there is no branch.

This is because later calls to SetIssue() would fail.

R=michaelpg@chromium.org
BUG= 611020 

Review-Url: https://codereview.chromium.org/2259993002

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

Project Member

Comment 11 by bugdroid1@chromium.org, Aug 18 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/tools/build.git/+/40fc2419139af2de77082e7349f4d8c701251bd0

commit 40fc2419139af2de77082e7349f4d8c701251bd0
Author: recipe-roller <recipe-roller@chromium.org>
Date: Thu Aug 18 23:35:24 2016

Roll recipe dependencies (trivial).

This is an automated CL created by the recipe roller. This CL rolls recipe
changes from upstream projects (e.g. depot_tools) into downstream projects
(e.g. tools/build).

More info is at https://goo.gl/zkKdpD. Use https://goo.gl/noib3a to file a bug
(or complain)

depot_tools:
  https://crrev.com/5d48c32f3d75691589c371266152b00aab355602 git cl: cleanup branch config get/set/unset. (tandrii@chromium.org)
  https://crrev.com/df09a46d7cec6d4a523a0bb7d740d70b3ac7c663 git cl patch: bail out quickly if there is no branch. (tandrii@chromium.org)

TBR=martiniss@chromium.org,phajdan.jr@chromium.org
BUG= 611020 

Recipe-Tryjob-Bypass-Reason: Autoroller
Review-Url: https://codereview.chromium.org/2259783003

[modify] https://crrev.com/40fc2419139af2de77082e7349f4d8c701251bd0/infra/config/recipes.cfg

Project Member

Comment 12 by bugdroid1@chromium.org, Aug 18 2016

Project Member

Comment 13 by bugdroid1@chromium.org, Aug 19 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/infra/infra.git/+/d209fcbd5de19f86fc38f4989982f68c24355146

commit d209fcbd5de19f86fc38f4989982f68c24355146
Author: recipe-roller <recipe-roller@chromium.org>
Date: Fri Aug 19 06:02:27 2016

Roll recipe dependencies (trivial).

This is an automated CL created by the recipe roller. This CL rolls recipe
changes from upstream projects (e.g. depot_tools) into downstream projects
(e.g. tools/build).

More info is at https://goo.gl/zkKdpD. Use https://goo.gl/noib3a to file a bug
(or complain)

build:
  https://crrev.com/40fc2419139af2de77082e7349f4d8c701251bd0 Roll recipe dependencies (trivial). (recipe-roller@chromium.org)
depot_tools:
  https://crrev.com/5d48c32f3d75691589c371266152b00aab355602 git cl: cleanup branch config get/set/unset. (tandrii@chromium.org)
  https://crrev.com/df09a46d7cec6d4a523a0bb7d740d70b3ac7c663 git cl patch: bail out quickly if there is no branch. (tandrii@chromium.org)

TBR=martiniss@chromium.org,phajdan.jr@chromium.org
BUG= 611020 

Recipe-Tryjob-Bypass-Reason: Autoroller
Review-Url: https://codereview.chromium.org/2256403003

[modify] https://crrev.com/d209fcbd5de19f86fc38f4989982f68c24355146/infra/config/recipes.cfg

Status: Fixed (was: Started)

Sign in to add a comment