Uploaded image for project: 'Qt Quality Assurance Infrastructure'
  1. Qt Quality Assurance Infrastructure
  2. QTQAINFRA-3689

gerrit_commit_msg_hook inserts second Change-Id line

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 2014q1
    • Fix Version/s: None
    • Component/s: Gerrit
    • Labels:
      None

      Description

      How to reproduce

      $ echo bla > bla.txt
      $ git add bla.txt
      $ git commit -m "Added bla" 
      $ git show
      commit 5909f36187f2c0517e7ded48e58f13c845095343 (HEAD -> dev)
      Author: Joerg Bornemann <joerg.bornemann@qt.io>
      Date:   Mon Apr 27 16:38:45 2020 +0200
      
          Added bla
          
          Change-Id: Iba3b4460c1cd4cbd4ced3941a95a393c26b63a92
      

      So far, so good. Now I'm adding non-footer text right above the Change-Id:

      $ git commit --amend
      $ git show
      commit db4cf893a4b46f624d2dc52e9290256cd9bf379f (HEAD -> dev)
      Author: Joerg Bornemann <joerg.bornemann@qt.io>
      Date:   Mon Apr 27 16:38:45 2020 +0200
      
          Added bla
          
          (cherry-picked from somewhere else)
          Change-Id: Iba3b4460c1cd4cbd4ced3941a95a393c26b63a92
          
          Change-Id: Ic7fbdfbc77328870ba91f5b83ffdbb132122c018
      

      Suddenly I have two Change-Ids. And because I noticed the second id after pushing, I'm going to amend again and remove the last change id.

      This will leave me with yet another second change id.

      This bug is especially annoying as the sanity bot suggests "Empty lines between footers" for commit messages like:

      Added bla
      
      (cherry-picked from somewhere else)
      
      Task-number: BUG-123
      Change-Id: Iba3b4460c1cd4cbd4ced3941a95a393c26b63a92
      

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            gerrit-admin Gerrit Admin
            Reporter:
            jbornema Joerg Bornemann
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes