You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by "Edward Ribeiro (JIRA)" <ji...@apache.org> on 2016/12/28 17:33:58 UTC

[jira] [Comment Edited] (ZOOKEEPER-2573) Modify Info.REVISION to adapt git repo

    [ https://issues.apache.org/jira/browse/ZOOKEEPER-2573?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15783323#comment-15783323 ] 

Edward Ribeiro edited comment on ZOOKEEPER-2573 at 12/28/16 5:33 PM:
---------------------------------------------------------------------

Hi [~arshad.mohammad] and [~hanm], I hope you don't mind, but I decided to take a stab at this issue. I would be really glad if you could test it, mainly in a Windows env, that I don't have access. :(

One minor issue I faced is that I think we could use the first 8 characters of the git SHA-1. On unix-like plataforms this is straighforward, just a matter of adding a call to {{cut}} command as below: 

{code}
git rev-parse HEAD | cut -c1-8
{code}

The problem is that on Windows there's no equivalent to {{cut}}, and it seemed cumbersome to add an equivalent. So, I left the full sha1 code as of now:

{code}
git rev-parse HEAD
{code}

**The patch is target at branch-3.4, but I was able to cherry-pick the commit to branch-3.5 and master**.

[~breed], [~phunt], and [~fpj], could you also see if the patch is okay, please?

Thanks!


was (Author: eribeiro):
Hi [~arshad.mohammad] and [~hanm], I hope you don't mind, but I decided to take a stab at this issue. I would be really glad if you could test it, mainly in a Windows env, that I don't have access. :(

One minor issue I faced is that I think we could use the first 8 characters of the git SHA-1. On unix-like plataforms this is straighforward, just a matter of adding a call to {{cut}} command as below: 

{code}
git rev-parse HEAD | cut -c1-8
{code}

The problem is that on Windows there's no equivalent to {{cut}}, and it seemed cumbersome to add an equivalent. So, I left the full sha1 code as of now:

{code}
git rev-parse HEAD
{code}

[~breed], [~phunt], and [~fpj], could you also see if the patch is okay, please?

Thanks!

> Modify Info.REVISION to adapt git repo
> --------------------------------------
>
>                 Key: ZOOKEEPER-2573
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2573
>             Project: ZooKeeper
>          Issue Type: Bug
>          Components: build, server
>            Reporter: Arshad Mohammad
>            Assignee: Edward Ribeiro
>             Fix For: 3.5.3, 3.6.0
>
>
> Modify {{org.apache.zookeeper.version.Info.REVISION}} to store git repo revision
> Currently {{org.apache.zookeeper.version.Info.REVISION}} stores the svn repo revision which is of type int
> But after migrating to git repo the git repo's revision(commit 63f5132716c08b3d8f18993bf98eb46eb42f80fb) can not be stored in this variable.
> So either we should modify this variable to string to introduce new variable to store the git revision and leave the svn revision variable unchanged.
> build.xml, and org.apache.zookeeper.version.util.VerGen also need to be modified. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)