<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>13703</bug_id>
          
          <creation_ts>2019-12-12 17:26:57 +0000</creation_ts>
          <short_desc>Create git update and pre-commit hook to prevent Groups.io e-mail in commit messages</short_desc>
          <delta_ts>2020-03-02 16:28:17 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>5</classification_id>
          <classification>Infrastructure</classification>
          <product>Infrastructure General</product>
          <component>infrastructure-general</component>
          <version>3.1</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>High</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>3.1 M3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Michael Halstead">mhalstead</reporter>
          <assigned_to name="Richard Purdie">richard.purdie</assigned_to>
          <cc>akuster808</cc>
    
    <cc>randy.macleod</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>85821</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Halstead">mhalstead</who>
    <bug_when>2019-12-12 17:26:57 +0000</bug_when>
    <thetext>In order to comply with DMARC Groups.io will rewrite the from lines of certain e-mails. We don&apos;t want these mangled e-mail addresses in our git repositories.

Write an update hook to prevent these from getting into the official repos.

Write a pre-commit hook maintainers can add to local repos to prevent bad addresses from being committed in the first place.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86204</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Halstead">mhalstead</who>
    <bug_when>2020-01-30 17:17:30 +0000</bug_when>
    <thetext>I&apos;m going to try to create these starting with the hooks below.

https://raw.githubusercontent.com/asadana/Git-Check-Author/master/pre-commit

https://raw.githubusercontent.com/asadana/Git-Check-Author/master/pre-receive</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86470</commentid>
    <comment_count>2</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2020-02-18 22:40:46 +0000</bug_when>
    <thetext>I don&apos;t know how to get git to reject local commits with incorrect addresses in as the git committer name isn&apos;t passed to any of the suitable hooks. I did have more success with the server side blocking. The poky repo now has a pre-receive hook that successfully prevents &apos;bad&apos; user names from being pushed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86471</commentid>
    <comment_count>3</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2020-02-18 23:18:10 +0000</bug_when>
    <thetext>Locally the best I&apos;ve been able to come up with is a post-applypatch which does:

#!/bin/bash
authorName=$(git log -1 --pretty=format:%an HEAD)
if [[ &quot;$authorName&quot; == *&quot;Openembedded-core&quot;* ]]; then
    echo &quot;####################################################################&quot;
    echo &quot;####################################################################&quot;
    echo &quot;Invalid Author $authorName&quot;
    echo &quot;####################################################################&quot;
    echo &quot;####################################################################&quot;
    git reset HEAD~1 --hard
fi</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86501</commentid>
    <comment_count>4</comment_count>
    <who name="Michael Halstead">mhalstead</who>
    <bug_when>2020-02-19 23:13:12 +0000</bug_when>
    <thetext>Richard&apos;s pre-receive hook is deployed on the OpenEmbeddeded and Yocto Project servers now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86502</commentid>
    <comment_count>5</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2020-02-19 23:22:41 +0000</bug_when>
    <thetext>When applying patches I&apos;m finding the easiest fix when hitting the warning is to swap the From and Reply-To: headers and git-am will then process the emails correctly. Ultimately I&apos;ll script that.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86571</commentid>
    <comment_count>6</comment_count>
    <who name="Armin Kuster">akuster</who>
    <bug_when>2020-02-23 23:06:07 +0000</bug_when>
    <thetext>I just tried pushing to stable/zeus-nut and got this error. The offending commit is already in mainline zeus.

akuster@akuster-ThinkPad-T460s:~/oss/stable/poky$ git push -f ssh://git@git.yoctoproject.org/poky-contrib.git  stable/zeus-nut:stable/zeus-nut
Counting objects: 399, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (187/187), done.
Writing objects: 100% (399/399), 77.11 KiB | 12.85 MiB/s, done.
Total 399 (delta 296), reused 284 (delta 206)
remote: Resolving deltas: 100% (296/296), completed with 100 local objects.
remote: ##############################################
remote: Invalid author Taras Kondratiuk via Openembedded-core
remote: ##############################################
To ssh://git.yoctoproject.org/poky-contrib.git
 ! [remote rejected]         stable/zeus-nut -&gt; stable/zeus-nut (pre-receive hook declined)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86578</commentid>
    <comment_count>7</comment_count>
    <who name="Michael Halstead">mhalstead</who>
    <bug_when>2020-02-24 17:08:05 +0000</bug_when>
    <thetext>Armin, are you confirming this is working as expected or reporting a problem?

Separately you need to update your remote to ssh://git@push.yoctoproject.org/poky-contrib.git to ensure reliable pushes in the future.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86579</commentid>
    <comment_count>8</comment_count>
    <who name="akuster">akuster808</who>
    <bug_when>2020-02-24 17:17:39 +0000</bug_when>
    <thetext>(In reply to comment #7)
&gt; Armin, are you confirming this is working as expected or reporting a problem?
&gt; 
&gt; Separately you need to update your remote to
&gt; ssh://git@push.yoctoproject.org/poky-contrib.git to ensure reliable pushes
&gt; in the future.

I reported a problem. Richard fixed it and things are good now.

thanks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86642</commentid>
    <comment_count>9</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2020-03-02 16:28:17 +0000</bug_when>
    <thetext>I think given the hooks installed and updated workflow tweaks people can use we&apos;ve resolved this as best we can now.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>