New issue
Advanced search Search tips

Issue 834980 link

Starred by 2 users

Issue metadata

Status: Available
Owner: ----
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug


Show other hotlists

Hotlists containing this issue:
Would-like-to-work-on


Sign in to add a comment

git cl patch fails when remote origin has a trailing slash

Project Member Reported by qyears...@chromium.org, Apr 19 2018

Issue description

Today I discovered an interesting minor bug in git cl patch; when the remote origin URL has a trailing slash, git cl doesn't work as expected.

To repro:

  mkdir /tmp/repro
  cd /tmp/repro
  git clone https://chromium.googlesource.com/infra/gerrit-plugins/buildbucket/
  cd buildbucket
  git cl patch 1019615

Actual result:

 Trying to patch a change from https://chromium.googlesource.com/infra/gerrit-plugins/buildbucket but this repo appears
 to be https://chromium.googlesource.com/infra/gerrit-plugins/buildbucket/.

Expected result:

 Committed patch for change 1019615 patchset 1 locally.                                     
 Note: this created a local commit which does not have the same hash as the one uploaded for review. This will make uploading changes based on top of this branch difficult.                   
 If you want to do that, use "git cl patch --force" instead.

Workaround:

 Edit the remote URL in .git/config

The fix should probably be a change somewhere around here:
https://cs.chromium.org/chromium/tools/depot_tools/git_cl.py?l=2801
 

Comment 1 by foss...@gmail.com, May 8 2018

Fixed this via the attached patchset and the git_cl_tests passed. I'd love some help with the official process of creating a gerrit request and merging this code in.
0001-git-cl-strip-trailing-slashes-from-remote-url-before.patch
853 bytes Download
Status: Available (was: Untriaged)

Sign in to add a comment