Hi Simon,

Simon Tournier <zimon.touto...@gmail.com> writes:

> Hi Maxim,
>
> On Sat, 09 Sep 2023 at 19:50, Maxim Cournoyer <maxim.courno...@gmail.com> 
> wrote:
>
>>>> --8<---------------cut here---------------start------------->8---
>>>> random=$({ git var GIT_COMMITTER_IDENT ; echo "$refhash" ; cat "$1"; } |
>>>>   git hash-object --stdin)
>>>> --8<---------------cut here---------------end--------------->8---
>>>
>>> That seems like it would only work if the patch was identical, as
>>> opposed to a slightly rebased patch on top of newer patches on master?
>>>
>>> How can you correlate Change-Id to a patch in the tracker?
>>
>> The Change-Id stays the same unless you manually edit it out of your
>> commit message when amending / rebasing, so the commit hash may change
>> while the Change-Id stays the same.  So you can rebase your feature
>> branch on master and share a v2, whose existing commits will have the
>> same Change-Ids (newly added commits would get their own Change-Id
>> trailer).
>
> I am sorry if I am slow but I do not understand.
>
> $ git var GIT_COMMITTER_IDENT
> Simon Tournier <zimon.touto...@gmail.com> 1694428674 +0200
> $ git var GIT_COMMITTER_IDENT
> Simon Tournier <zimon.touto...@gmail.com> 1694428800 +0200
>
> Therefore this Change-Id can be different for the same series, depending
> when I am locally committing.  No?
>
> And sorry if I am slow but I am also missing your answer about “How can
> you correlate Change-Id to a patch in the tracker?”.  How is this
> Change-Id correlated to the Debbugs number?

The commit hook job is simple: generate a unique ID.  The magic is that
it only adds it *once* to a commit message; if it finds the 'Change-Id:'
line already present in it, it won't refresh its value or add a new one.
So it's immutable once added, preserved in the Git commit message
itself.

> Let take an example. :-) Assume Change-Id was used for your submission
> bug#65280 about Qt.  It reads many patches and we have:
>
>         02/59
>         1717c8a233b7fda3a10aabc061168c71317f883e
>         AuthorDate: Fri Aug 11 15:26:14 2023 -0400
>
>         59/59
>         0a77b869322274030c4c0e8315ddea802da44c92
>         AuthorDate: Tue Aug 15 16:20:10 2023 -0400
>
> From my understanding,
>
>  1. GIT_COMMITTER_IDENT depends on time so these two commits would have
> a different Change-Id, no?

Correct.  The commit hook adds a unique ID *per* commit.

>  2. How is Change-Id linked to #65280?

Each patch submission ("issue") can have one or multiple commits.  We'd
know for sure the series was merged (and thus can be closed) when the
set of 'Change-Id's its commits contains have all appeared in the master
branch.  The mapping of Debbugs ID <-> set(change-ids) would need to be
established by an external tool such as Mumi (which I think is in a good
position to do so).

I hope that helps!

-- 
Thanks,
Maxim

Reply via email to