Gerrit "No changes detected"

678 views
Skip to first unread message

William Roberts

unread,
Dec 8, 2012, 7:44:04 PM12/8/12
to repo-d...@googlegroups.com
I recently have been working on patches for AOSP and submitting them to Gerrit. However, I recently encountered an issue with Gerrit not taking my changes due to "No changes detected" error. Below are the steps I did:

1. Create a patch and git push remote HEAD:refs/for/master
2. Switch to another computer and cherry pick that commit locally from Gerrit
3. Make a change on the computer where the commit was cherry picked too and then git commit --amend -a
4. git push remote HEAD:refs/for/master (Error no changes detected)

I could diff my local with the remote and see that their was indeed the change in that patch series, but Gerrit wouldn't pick it up. Is their something I am doing wrong?

Luciano Carvalho

unread,
Dec 8, 2012, 11:14:57 PM12/8/12
to William Roberts, Repo and Gerrit Discussion

Try "got commit --amend", remove the Change-Id line and save.

Then push again.

It should work.

William Roberts

unread,
Dec 9, 2012, 12:11:45 AM12/9/12
to Luciano Carvalho, Repo and Gerrit Discussion
Yes and then you get a whole new patch series, that is what I did. But
it ends up breaking the patch sets. I want to keep the changes
contiguous, so all the comments and review are preserved as one
change-id. This should be possible as this works fine normally. The
only changes I made to my normal workflow this time is cherry pickiing
a patch from server and making changes and then pushing them back from
another machine.
--
Respectfully,

William C Roberts

Luciano Carvalho

unread,
Dec 9, 2012, 1:09:01 AM12/9/12
to William Roberts, Repo and Gerrit Discussion

I thought you were trying to push to a different branch.

William Roberts

unread,
Dec 9, 2012, 4:14:14 PM12/9/12
to Marcelo Avila de Oliveira, Luciano Carvalho, Repo and Gerrit Discussion
Ok so to clarify, it wasn't the same patch.

I was on patch series 4 of my change-id. I had to switch to another
machine, where my local changes were not present. I cherry picked
patch 4 from gerrit down to my local branch on my new machine. Made my
changes and tried to push back. When I commited I ammended the change
and I made sure all the changes were added. When I pushed to
refs/for/master (to try and create patch #5) that is when Gerrit said
no changes detected and would not take my patch.

However, I could diff the remote patch set 4 with my local patch set
5, their was indeed changes, however Gerrit was wrongly reporting
this. I think their is a bug in Gerrit or for some reason my workflow
casued this issue. That is what I am trying to sort out, is this a bug
in Gerrit or some strange side effect of cherry picking the remote
patch back down to work on it.


On Sun, Dec 9, 2012 at 11:17 PM, Marcelo Avila de Oliveira
<mav...@cpqd.com.br> wrote:
> William Roberts <bill.c....@gmail.com> wrote:
>>
>> Yes and then you get a whole new patch series, that is what I did. But
>> it ends up breaking the patch sets.
>
>
> Have you done this first and after that tried using the same Change-Id? If
> so, I think Gerrit will refuse to receive the patch with "no changes
> detected" error because this change already exists for master branch. You
> can't push the same change for the same branch twice.
>
> I hope this helps,
>
> --
> Marcelo Ávila de Oliveira
> CPqD - Information Technology Enginner
> Tel.: +55 19 3705-4125
> mav...@cpqd.com.br
> www.cpqd.com.br

William Roberts

unread,
Dec 9, 2012, 4:55:47 PM12/9/12
to Marcelo Avila de Oliveira, Luciano Carvalho, Repo and Gerrit Discussion
On Mon, Dec 10, 2012 at 6:51 AM, Marcelo Avila de Oliveira
<mav...@cpqd.com.br> wrote:
> Ok William, I tried to reproduce your issue but your steps worked as
> expected for me (I was able to create a new patch from a new area cherry
> picking the original patch first).
>
> Some thoughts:
>
> - I'm using Gerrit 2.5-703-g5178a7d... what version are you using?
Whatever one AOSP is using
> - You used the same "user" at the two machines, correct?
Yes
> - I used a different repo area at the same machine to cherry pick (instead
> of use a different machine), I don't think this is an issue...
I don't think so either
>
> --
> Marcelo Ávila de Oliveira
> CPqD - Information Technology Enginner
> Tel.: +55 19 3705-4125

In my mind what I did should have worked as it did for you. But the
only thing that is different is a seperate machine. Very strange.

> mav...@cpqd.com.br
> www.cpqd.com.br
>
> On Sun, Dec 9, 2012 at 7:14 PM, William Roberts <bill.c....@gmail.com>

Pursehouse, David

unread,
Dec 9, 2012, 8:32:51 PM12/9/12
to William Roberts, repo-d...@googlegroups.com

> 4. git push remote HEAD:refs/for/master (Error no changes detected)

 

Is the exact error message?  I can’t find any such error message in the source code.  The closest I find is “no changes made”.

 

This error is returned when:

 

A pushed commit is considered to be identical to the current patch

set if

 

- the files in the commit,

- the commit message,

- the author of the commit and

- the parents of the commit

 

are all identical.

 

Are you sure all your changed files are added?  What does “git status” say?

 

Does it work if you make any change to the commit message?

Pursehouse, David

unread,
Dec 10, 2012, 2:01:34 AM12/10/12
to William Roberts, repo-d...@googlegroups.com

I’ve just had this error which I guess is the same one you’re experiencing.

 

$ git push upstream HEAD:refs/for/master

remote: Receiving objects: 100% (29/29)

remote: Resolving deltas: 100% (15/15)

remote: Processing changes: refs: 1, done   

To https://gerrit.googlesource.com/gerrit

! [remote rejected] HEAD -> refs/for/master (no changes made)

error: failed to push some refs to 'https://gerrit.googlesource.com/gerrit'

 

In my case I did:

 

Cherry pick change A

Make edits, commit, push

Cherry pick change B (on top of A)

Make edits to change B, commit, push

 

I think it’s failing because on the second push the content of change A is identical to the first push.  After doing an interactive rebase and changing the commit message of A, the push works.

--

William Roberts

unread,
Dec 10, 2012, 2:03:25 AM12/10/12
to Pursehouse, David, repo-d...@googlegroups.com
I did an interactive rebase and even changed my commit message

Marcelo Avila de Oliveira

unread,
Dec 9, 2012, 4:51:57 PM12/9/12
to William Roberts, Luciano Carvalho, Repo and Gerrit Discussion
Ok William, I tried to reproduce your issue but your steps worked as expected for me (I was able to create a new patch from a new area cherry picking the original patch first).

Some thoughts:

- I'm using Gerrit 2.5-703-g5178a7d... what version are you using?
- You used the same "user" at the two machines, correct?
- I used a different repo area at the same machine to cherry pick (instead of use a different machine), I don't think this is an issue...
--
Marcelo Ávila de Oliveira
CPqD - Information Technology Enginner

Marcelo Avila de Oliveira

unread,
Dec 9, 2012, 9:17:38 AM12/9/12
to Luciano Carvalho, William Roberts, Repo and Gerrit Discussion
William Roberts <bill.c....@gmail.com> wrote:
Yes and then you get a whole new patch series, that is what I did. But
it ends up breaking the patch sets.

Have you done this first and after that tried using the same Change-Id? If so, I think Gerrit will refuse to receive the patch with "no changes detected" error because this change already exists for master branch. You can't push the same change for the same branch twice.

I hope this helps,

--
Marcelo Ávila de Oliveira
CPqD - Information Technology Enginner

On Sun, Dec 9, 2012 at 4:09 AM, Luciano Carvalho <lsca...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages