commit-msg in Gerrit 2.16 is not working with git 1.8.3.1 on CentOS 7

145 views
Skip to first unread message

Paul Tung

unread,
Nov 28, 2018, 2:39:34 AM11/28/18
to Repo and Gerrit Discussion
Hi there,

After update my Gerrit from 2.15 -> 2.16, I found the "commit-msg" has been changed and not compatible to git 1.8.3.1 anymore.

Seems it has updated in 2.16:

Now I copy the old version to colleagues who new clone the repo and replace downloaded from Gerrit server.

I knew a way is to upgrade git 2.x, but it is too hard to approach in my company.

Is there any other elegant way to solve it?

Thanks!
Paul

Luca Milanesio

unread,
Nov 28, 2018, 3:17:42 AM11/28/18
to Paul Tung, Luca Milanesio, Repo and Gerrit Discussion

On 28 Nov 2018, at 07:39, Paul Tung <baiba...@gmail.com> wrote:

Hi there,

After update my Gerrit from 2.15 -> 2.16, I found the "commit-msg" has been changed and not compatible to git 1.8.3.1 anymore.

Seems it has updated in 2.16:

Now I copy the old version to colleagues who new clone the repo and replace downloaded from Gerrit server.

I knew a way is to upgrade git 2.x, but it is too hard to approach in my company.

Git 1.8.x has been released 6 years ago, 2.x released 4 years ago: too hard?

Luca.


Is there any other elegant way to solve it?

Thanks!
Paul

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Luca Milanesio

unread,
Nov 28, 2018, 3:28:54 AM11/28/18
to Paul Tung, Luca Milanesio, Repo and Gerrit Discussion

On 28 Nov 2018, at 08:17, Luca Milanesio <luca.mi...@gmail.com> wrote:



On 28 Nov 2018, at 07:39, Paul Tung <baiba...@gmail.com> wrote:

Hi there,

After update my Gerrit from 2.15 -> 2.16, I found the "commit-msg" has been changed and not compatible to git 1.8.3.1 anymore.

Seems it has updated in 2.16:

Now I copy the old version to colleagues who new clone the repo and replace downloaded from Gerrit server.

I knew a way is to upgrade git 2.x, but it is too hard to approach in my company.

Git 1.8.x has been released 6 years ago, 2.x released 4 years ago: too hard?

However, dropping the support for Git 1.8.x wasn't documented in the release notes: going to add it now.
I have possibly missed it when I was putting them together, apologies for that.

Luca.

Luca Milanesio

unread,
Nov 28, 2018, 3:33:19 AM11/28/18
to Paul Tung, Luca Milanesio, Repo and Gerrit Discussion
On 28 Nov 2018, at 08:17, Luca Milanesio <luca.mi...@gmail.com> wrote:



On 28 Nov 2018, at 07:39, Paul Tung <baiba...@gmail.com> wrote:

Hi there,

After update my Gerrit from 2.15 -> 2.16, I found the "commit-msg" has been changed and not compatible to git 1.8.3.1 anymore.

Seems it has updated in 2.16:

Now I copy the old version to colleagues who new clone the repo and replace downloaded from Gerrit server.

I knew a way is to upgrade git 2.x, but it is too hard to approach in my company.

Git 1.8.x has been released 6 years ago, 2.x released 4 years ago: too hard?

Going to add in the release notes a "workaround" if you want to stick with Git 1.8.x :-)
That would "ease the pain" for your company.

Luca.

Luca Milanesio

unread,
Nov 28, 2018, 3:48:52 AM11/28/18
to baiba...@gmail.com, Luca Milanesio, Repo and Gerrit Discussion


On 28 Nov 2018, at 08:44, GMail_BaiBai.Tung <baiba...@gmail.com> wrote:

Great thanks for your quick response, no need to apologies. :)

I know it sounds no sense, but ... uh ... can't say.

I am looking forward to your "pain workaround" and maybe an excuse to push to update 2.x. :P

There you go:

Once reviewed, is going to be incorporated in the official release notes.

Luca.


Thanks again!


Best regards,
Paul.Tung


Luca Milanesio <luca.mi...@gmail.com> 於 2018年11月28日 週三 下午4:33寫道:

GMail_BaiBai.Tung

unread,
Nov 28, 2018, 3:58:10 AM11/28/18
to luca.mi...@gmail.com, repo-d...@googlegroups.com
Got it and thanks a lot! 


Best regards,
Paul.Tung


Luca Milanesio <luca.mi...@gmail.com> 於 2018年11月28日 週三 下午4:48寫道:

Giuseppe Salvatore

unread,
Nov 28, 2018, 5:24:22 AM11/28/18
to Repo and Gerrit Discussion
Hi,

I have the same problem with my company. They are stuck with using CentOS with the official repositories and there is no way to get a git 2.x (unless we get the rpm from somewhere else... but that would upset our IT).
And this is just because CentOS is suggested for enterprise environment (not sure where this comes from, bs to me... personally I would stick with Debian all my life)
Sorry, just saying.

Giuseppe

Luca.

luca.mi...@gmail.com

unread,
Nov 28, 2018, 5:29:11 AM11/28/18
to Giuseppe Salvatore, Repo and Gerrit Discussion


Sent from my iPhone

On 28 Nov 2018, at 10:24, Giuseppe Salvatore <giuseppe....@gmail.com> wrote:

Hi,

I have the same problem with my company. They are stuck with using CentOS with the official repositories and there is no way to get a git 2.x (unless we get the rpm from somewhere else... but that would upset our IT).

On CentOS you need to build from source.

And this is just because CentOS is suggested for enterprise environment (not sure where this comes from, bs to me... personally I would stick with Debian all my life)
Sorry, just saying.

The workaround documented in the release notes (in review) should work for you as well :-)

HTH

Luca

To unsubscribe, email repo-discuss...@googlegroups.com

Matthew Webber

unread,
Nov 28, 2018, 5:37:32 AM11/28/18
to Repo and Gerrit Discussion
I have the same problem with my company. They are stuck with using CentOS with the official repositories and there is no way to get a git 2.x (unless we get the rpm from somewhere else... but that would upset our IT)

Our IT  management use the "git2u" package from cobbler (replacing "git" from the main RHEL7 repos), so we currently have:
$ git --version
git version
2.16.4

That means it's a standard RPM from a known source that gets installed using the standard mechanisms (we use cfengine).
I don't know if that helps.
Matthew


Paul Tung

unread,
Nov 29, 2018, 2:22:17 AM11/29/18
to Repo and Gerrit Discussion
Hi Luca.,

I adopted the workaround and found a little problems, here is the detail for your reference:

[part I]
1. It should be add "/" in the end of "static"    => .... > $GERRIT_SITE/static/
2. Even so, the downloaded file is garbled.
    => I change to download and un-tar the file with
curl https://gerrit.googlesource.com/gerrit/+archive/stable-2.15/gerrit-server/src/main/resources/com/google/gerrit/server/tools/root/hooks.tar.gz -o /tmp/hook.tar.gz && tar -jxvf /tmp/hook.tar.gz -C $GERRIT_SITE/static/ && rm -f /tmp/hook.tar.gz

[part II]
git config -f $GERRIT_SITE/etc/gerrit.config gerrit.installCommitMsgHookCommand 'gitdir=$(git rev-parse --git-dir); curl -o ${gitdir}/hooks/commit-msg https://gerrit.mycompany.com/static/commit-msg ; chmod +x ${gitdir}/hooks/commit-msg
It just leak a single quotation in the end of command   => ... chmod
 +x ${gitdir}/hooks/commit-msg'


Then the workaround is working perfectly!

Thanks for your wonderful help!


Best regards,
Paul


lucamilanesio於 2018年11月28日星期三 UTC+8下午4時48分52秒寫道:

Luca Milanesio

unread,
Nov 29, 2018, 4:16:28 AM11/29/18
to Paul Tung, Luca Milanesio, Repo and Gerrit Discussion

On 29 Nov 2018, at 07:22, Paul Tung <baiba...@gmail.com> wrote:

Hi Luca.,

I adopted the workaround and found a little problems, here is the detail for your reference:

[part I]
1. It should be add "/" in the end of "static"    => .... > $GERRIT_SITE/static/
2. Even so, the downloaded file is garbled.
    => I change to download and un-tar the file with
curl https://gerrit.googlesource.com/gerrit/+archive/stable-2.15/gerrit-server/src/main/resources/com/google/gerrit/server/tools/root/hooks.tar.gz -o /tmp/hook.tar.gz && tar -jxvf /tmp/hook.tar.gz -C $GERRIT_SITE/static/ && rm -f /tmp/hook.tar.gz

[part II]
git config -f $GERRIT_SITE/etc/gerrit.config gerrit.installCommitMsgHookCommand 'gitdir=$(git rev-parse --git-dir); curl -o ${gitdir}/hooks/commit-msg https://gerrit.mycompany.com/static/commit-msg ; chmod +x ${gitdir}/hooks/commit-msg
It just leak a single quotation in the end of command   => ... chmod
 +x ${gitdir}/hooks/commit-msg'

Yes, noticed that and I've fixed it as PS2 in the same change :-)



Then the workaround is working perfectly!

Glad that this helped :-)

Luca.


Thanks for your wonderful help!


Best regards,
Paul


lucamilanesio於 2018年11月28日星期三 UTC+8下午4時48分52秒寫道:

Reply all
Reply to author
Forward
0 new messages