alanbian / git-repo

Automatically exported from code.google.com/p/git-repo
Apache License 2.0
0 stars 0 forks source link

Error message when "upload --replace" doesn't modify a particular change #28

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Reported by Dave Bort <dbort@android.com> on Thu Apr 30 18:21:35 PDT 2009
Source: JIRA REPO-30
Affected Version: 1.6.7.2

I have a project with two commits on it, which I had uploaded, thus creating
two changes.

I made a change to the HEAD commit, and wanted to update the change.  Since I
only touched HEAD, the change based on HEAD^ didn't actually need to change.

I ran "repo upload --replace", and entered the numbers for the two changes.

When I exited the editor, repo failed with an error, but still did what I
wanted it to do:

$ repo upload --replace .
Counting objects: 18, done.
Delta compression using 4 threads.
Compressing objects: 100% (10/10), done.
Writing objects: 100% (10/10), 3.41 KiB, done.
Total 10 (delta 6), reused 0 (delta 0)
To ssh://me@example.com:29418/platform/frameworks/base
 * [new branch]      config -> refs/for/donut
 * [new branch]      74114a38e5da300d6094c7a610399d0bed557de0 -> refs/changes/
847/new
 ! [remote rejected] 8015cf1cc3698542407c316918de20683da32d66 -> refs/changes/
845/new (patch set exists)
error: failed to push some refs to 'ssh://dbort@android-git.corp.google.com:
29418/platform/frameworks/base'

--------------------------------------------
[FAILED] frameworks/base/ config           (Upload failed)

I see two ways to solve this:
1. Recognize that the "patch set exists" error means that this upload is a no-
op, and treat it as success
2. Provide a way for upload --replace to let me mark a commit as "do not re-
upload".

(1) seems to be the most straightforward, especially since repo actually did
what I wanted it to do (the HEAD commit was pushed successfully), unless
there are some other cases where  "patch set exists" is actually an error.

(2) would be nice, especially since then I wouldn't have to look up the change
number for a push that I know will be a no-op, but this is tricky from a UI
perspective.  You should only be able to set "do not re-upload" on commits
whose parents are already submitted/merged or whose parents are also being
marked "do not re-upload".

Anyway, this seems like a corner case, and it did what I wanted it to, so I'm
marking it as "Minor".

Original issue reported on code.google.com by code-rev...@gtempaccount.com on 24 Sep 2009 at 9:10

GoogleCodeExporter commented 9 years ago

Original comment by sop+code@google.com on 24 Sep 2009 at 11:10

GoogleCodeExporter commented 9 years ago
With the introduction of Change-Id in Gerrit Code Review, I think most users are
trying to rely on that feature instead of `repo upload --replace`.  As such I 
plan
to remove the --replace option in the future and thus becomes moot.

Original comment by sop+code@google.com on 24 Sep 2009 at 11:17