2 change with same change-id in different repositories

552 views
Skip to first unread message

Matthias Sohn

unread,
Jan 15, 2012, 3:21:33 AM1/15/12
to Repo and Gerrit Discussion
We've got 2 changes for 2 different repositories hosted on the same gerrit 
server having the same change-id

Is this a bug or a feature ? If it's a feature the change-id can't be used
anymore to un-ambiguously link to a change.

--
Matthias

Martin Fick

unread,
Jan 16, 2012, 3:07:05 PM1/16/12
to repo-d...@googlegroups.com, Matthias Sohn

I believe that it is a feature. It is most often used to
have the same change on two different branches of the same
project,

-Martin

--
Employee of Qualcomm Innovation Center, Inc. which is a
member of Code Aurora Forum

Matthias Sohn

unread,
Jan 16, 2012, 4:43:39 PM1/16/12
to Martin Fick, repo-d...@googlegroups.com


2012/1/16 Martin Fick <mf...@codeaurora.org>

On Sunday, January 15, 2012 01:21:33 am Matthias Sohn wrote:
> We've got 2 changes for 2 different repositories hosted
> on the same gerrit server having the same change-id
> http://egit.eclipse.org/r/#q,I74a82b31505fadf8378069c5f65
> 54f1033c28f9b,n,z
>
> Is this a bug or a feature ? If it's a feature the
> change-id can't be used anymore to un-ambiguously link
> to a change.

I believe that it is a feature.  It is most often used to
have the same change on two different branches of the same
project,

ok, this is useful, but what is then the way of unambiguously hyper-linking
to a single change ? 

--
Matthias

Magnus Bäck

unread,
Jan 16, 2012, 5:11:27 PM1/16/12
to repo-d...@googlegroups.com
On Monday, January 16, 2012 at 22:43 CET,
Matthias Sohn <matthi...@googlemail.com> wrote:

> 2012/1/16 Martin Fick <mf...@codeaurora.org>


>
> > I believe that it is a feature. It is most often used to
> > have the same change on two different branches of the same
> > project,
>
> ok, this is useful, but what is then the way of unambiguously
> hyper-linking to a single change ?

The change number or the commit SHA-1?

--
Magnus Bäck Opinions are my own and do not necessarily
SW Configuration Manager represent the ones of my employer, etc.
Sony Ericsson

Martin Fick

unread,
Jan 16, 2012, 5:18:38 PM1/16/12
to repo-d...@googlegroups.com, Magnus Bäck
On Monday, January 16, 2012 03:11:27 pm Magnus Bäck wrote:
> On Monday, January 16, 2012 at 22:43 CET,
>
> Matthias Sohn <matthi...@googlemail.com> wrote:
> > 2012/1/16 Martin Fick <mf...@codeaurora.org>
> >
> > > I believe that it is a feature. It is most often
> > > used to have the same change on two different
> > > branches of the same project,
> >
> > ok, this is useful, but what is then the way of
> > unambiguously hyper-linking to a single change ?
>
> The change number or the commit SHA-1?

Change number.

The commit SHA1 can be the same on multiple changes also, we
just had that problem internally, for the same branch even!

Pravin

unread,
Jan 16, 2012, 11:14:53 PM1/16/12
to Repo and Gerrit Discussion
> I believe that it is a feature. It is most often used to
> have the same change on two different branches of the same
> project,

The example cited by Matthias has two changes on different
projects and still having the same Change-Id. Isn't this a bug?

Thanks,
Pravin

Martin Fick

unread,
Jan 16, 2012, 11:20:49 PM1/16/12
to Pravin, Repo and Gerrit Discussion

Imagine two projects with the same file in them with the same bug. Just like if they were on 2 branches in the same project, it makes sense to apply the same fix (change) to both projects,

-Martin
Employee of Qualcomm Innovation Center,Inc. which is a member of Code Aurora Forum

Pravin

unread,
Jan 16, 2012, 11:30:10 PM1/16/12
to Repo and Gerrit Discussion
Thanks Martin

I am still not clear on this. Except the commit message everything
seems
to be different. e.g.The two changes affect totally different set of
files.
Can the change-Id still be the same?

On Jan 17, 9:20 am, Martin Fick <mf...@codeaurora.org> wrote:

Martin Fick

unread,
Jan 16, 2012, 11:44:54 PM1/16/12
to Pravin, Repo and Gerrit Discussion

Pravin <pra...@nvidia.com> wrote:
>
>I am still not clear on this. Except the commit message everything
>seems
>to be different. e.g.The two changes affect totally different set of
>files.
>Can the change-Id still be the same?

Since users can assign any changeid to any commit that they want (unlike a git sha1, there is nothing which enforces it to be derived from the code, even if it is a good idea to make it be so originally). But the intent of a changeid is to represent patchsets related to a common logical idea. While it may not be common, I believe that a reasonable case could he made under certain circumstances that the same logical idea applies to multiple projects, it is these cases which I feel justifies allowing the same changeid on different projects.

-Martin

Note also that nothing prevents the same git commit (sha1) from being used in multiple projects, and I don't mean because of collisions.

Matthias Sohn

unread,
Jan 17, 2012, 2:13:13 AM1/17/12
to Martin Fick, Pravin, Repo and Gerrit Discussion
2012/1/17 Martin Fick <mf...@codeaurora.org>



Pravin <pra...@nvidia.com> wrote:
>
>I am still not clear on this. Except the commit message everything
>seems
>to be different. e.g.The two changes affect totally different set of
>files.
>Can the change-Id still be the same?

Since users can assign any changeid to any commit that they want (unlike a git sha1, there is nothing which enforces it to be derived from the code, even if it is a good idea to make it be so originally).  But the intent of a changeid is to represent patchsets related to a common logical idea.  While it may not be common, I believe that a reasonable case could he made under certain circumstances that the same logical idea applies to multiple projects, it is these cases which I feel justifies allowing the same changeid on different projects.

ok, this makes sense
 
-Martin

Note also that nothing prevents the same git commit (sha1) from being used in multiple projects, and I don't mean because of collisions.

yes, though it's very unlikely since it's a hash over the content and history

--
Matthias

Magnus Bäck

unread,
Jan 17, 2012, 2:17:24 AM1/17/12
to Repo and Gerrit Discussion
On Tuesday, January 17, 2012 at 08:13 CET,
Matthias Sohn <matthi...@googlemail.com> wrote:

> 2012/1/17 Martin Fick <mf...@codeaurora.org>

[...]

> > Note also that nothing prevents the same git commit (sha1) from
> > being used in multiple projects, and I don't mean because of
> > collisions.
>
> yes, though it's very unlikely since it's a hash over the content and
> history

You're talking about a collision, but I believe what Martin referred to
was two projects that share the same history and where you in fact can
reuse the exact same commit. Example:

git push ssh://hostname/project1 HEAD:refs/for/master
git push ssh://hostname/project2 HEAD:refs/for/master

Martin Fick

unread,
Jan 17, 2012, 2:16:43 AM1/17/12
to Magnus Bäck, Repo and Gerrit Discussion

"Magnus Bäck" <magnu...@sonyericsson.com> wrote:

>On Tuesday, January 17, 2012 at 08:13 CET,
> Matthias Sohn <matthi...@googlemail.com> wrote:
>
>> 2012/1/17 Martin Fick <mf...@codeaurora.org>
>
>[...]
>
>> > Note also that nothing prevents the same git commit (sha1) from
>> > being used in multiple projects, and I don't mean because of
>> > collisions.
>>
>> yes, though it's very unlikely since it's a hash over the content and
>> history
>
>You're talking about a collision, but I believe what Martin referred to
>was two projects that share the same history and where you in fact can
>reuse the exact same commit. Example:
>
>git push ssh://hostname/project1 HEAD:refs/for/master
>git push ssh://hostname/project2 HEAD:refs/for/master

Yes, thank-you.

Matthias Sohn

unread,
Jan 17, 2012, 2:40:14 AM1/17/12
to Martin Fick, Magnus Bäck, Repo and Gerrit Discussion
2012/1/17 Martin Fick <mf...@codeaurora.org>
ok, now I got it :-)
 
--
Matthias
Reply all
Reply to author
Forward
0 new messages