[Development] Using Git notes to reflect actual cherry-picks

Tor Arne Vestbø Tor.arne.Vestbo at qt.io
Sat Feb 12 16:15:36 CET 2022

Very cool! As ossi suggests, this could potentially be handled by Gerrit, similar to this:


If we enable something like this we should namespace the notes, e.g. refs/notes/cherry-picks so that fetching and showing them in git log output is optional.

Tor Arne

sOn 12 Feb 2022, at 08:04, Thiago Macieira <thiago.macieira at intel.com<mailto:thiago.macieira at intel.com>> wrote:

Implementation: https://codereview.qt-project.org/c/qt/qtbase/+/395465
(I don't think qtbase is the right place for this)

I'd like to propose we use Git notes to include information into commits about
successful cherry-picks. I have the scripts done, see above. All we need is
that they are run weekly or the results pushed into the repository.

Long version:
The Pick-To footer is very useful so we don't have to remember to actually
cherry-pick a commit when it's done integrating: the bot will take care of
doing that for us and let us know if it fails. However, it's not reliable:

* a change may be abandoned in Gerrit after the bot started with it (too
  difficult to continue, author didn't realise it didn't apply, etc.)
* a change may be cherry-picked without the footer, either in Gerrit or
  directly using git cherry-pick -x

For that reason, I'd like to ask that we add the use of notes, to indicate
cherry-picks that have succeeded. Moreover, it will tell the user what commit
exists in that particular branch. For example, after running the script, I see
for a commit of mine:

   Pick-to: 6.2.3 6.2 6.3
   Change-Id: Icad7c1bad46a449c8e8afffd16cb743e622b3405
   Reviewed-by: Lars Knoll <lars.knoll at qt.io<mailto:lars.knoll at qt.io>>

       6.3: 34545edc501947a498bc6b1873624a5e307a7b1a

That tells us that the cherry-picks to 6.2 and 6.2.3 aren't present (I
abandoned after conflicts happened).


   Fixes: QTBUG-99668
   Pick-to: 6.3 6.2 6.2.3 5.15
   Change-Id: I07321ad91be5adce524be18e4ab82eee7110dc6a
   Reviewed-by: Mårten Nordheim <marten.nordheim at qt.io<mailto:marten.nordheim at qt.io>>

       6.2.3: 4db05007d72963c082f3ffdfcc7a68c1fb53c266
       6.3: 84ab463aa3e75c2b78f99d62c95577c6a0b5950f

This one looks wrong: 6.2.3 is present but not 6.2, So I searched Gerrit and
indeed, the change simply failed in the CI 3 weeks ago and no one pushed the
button again.

The scripts are pretty fast, but I've also made them work incrementally. See
the attached run example.
Thiago Macieira - thiago.macieira (AT) intel.com<http://intel.com>
 Software Architect - Intel DPG Cloud Engineering
Development mailing list
Development at qt-project.org<mailto:Development at qt-project.org>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20220212/2d1b2877/attachment.htm>

More information about the Development mailing list