Re: How to abandon a local commit, which is abandoned on Gerrit

954 views
Skip to first unread message

Luciano Carvalho

unread,
Aug 29, 2012, 7:38:52 AM8/29/12
to Robert Bu, repo-d...@googlegroups.com

It's probably because you still have it in your local and when you push the new one, it'll be pushed again.

Also, you have removed it from a tree, but it may be still in the reflog or some other file that's keeping a pointer to it, avoiding its deletion.

Two things you'll have to do:

1) when you remove it from the tree, cleanup the reflogs and run a gc.

2) rebase your new commit locally, make sure that the unneeded commit is not the base for the commit you're pushing. If it still shows in the local log it'll be pushed again.

Luciano.

On Aug 29, 2012 6:03 AM, "Robert Bu" <robe...@gmail.com> wrote:
Hi,

I've abandoned a commit/change on Gerrit server. And I've deleted the commit locally with git. With "git log" I can not see the deleted local commit any longer. However, when I try to upload a new commit, repo reports that the should-been-deleted commit comes before my new commit.

How can I tell repo that the commit is deleted?

--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

Magnus Bäck

unread,
Aug 29, 2012, 8:58:43 AM8/29/12
to repo-d...@googlegroups.com
On Wednesday, August 29, 2012 at 06:55 EDT,
Robert Bu <robe...@gmail.com> wrote:

> I've abandoned a commit/change on Gerrit server. And I've deleted the
> commit locally with git.

How?

> With "git log" I can not see the deleted local commit any longer.
> However, when I try to upload a new commit, repo reports that the
> should-been-deleted commit comes before my new commit.
>
> How can I tell repo that the commit is deleted?

You're using "repo upload"? That command basically does (see project.py)

git rev-list --pretty=oneline upstream..topic

to figure out which commits that need to be uploaded, so it would seem
unlikely that you're not seeing the commit with "git log". Could you
show example command output? You can obfuscate commit messages and
author names if you like (just do it consistently).

--
Magnus Bäck
ba...@google.com
Reply all
Reply to author
Forward
0 new messages