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

2017-04-11 Thread Michael Han (JIRA)

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

Michael Han commented on ZOOKEEPER-2573:


please ignore the previous posts by bot ^ - the pull request accidentally used 
wrong JIRA number.

> 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
>Affects Versions: 3.4.9, 3.5.2
>Reporter: Mohammad Arshad
>Assignee: Edward Ribeiro
> Fix For: 3.4.10, 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.15#6346)


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

2017-04-11 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ZOOKEEPER-2573:
---

GitHub user hanm opened a pull request:

https://github.com/apache/zookeeper/pull/224

ZOOKEEPER-2573: Introduce a python script that generates flaky tests report.

The script is self explaining, here are some notes:

* The original work is done by Appy at Cloudera HBase team.
* The script is customized to fit ZooKeeper's use cases, in particular 
ZooKeeper allows duplicate test runs, unlike HBase. For example same test could 
be run three times, one by the test itself, one by Netty test suite, and one by 
NIO test suite. Script is updated to account for this factor when processing 
and analyzing test results.
* There will be an Apache Jenkins job set up to run this script on regular 
basis and publish results dashboard somewhere publicly accessible. For a 
preview of the dashboard, see 
http://home.apache.org/~hanm/dashboard/report.html.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/hanm/zookeeper ZOOKEEPER-2573

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/zookeeper/pull/224.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #224


commit 8ef788a5d38e32b333a08e0cf1bf6a9d7fbaa013
Author: Michael Han 
Date:   2017-04-11T22:21:07Z

ZOOKEEPER-2573: Introduce a python script for generating flaky test report.




> 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
>Affects Versions: 3.4.9, 3.5.2
>Reporter: Mohammad Arshad
>Assignee: Edward Ribeiro
> Fix For: 3.4.10, 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.15#6346)


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

2017-01-25 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ZOOKEEPER-2573:
---

Github user eribeiro closed the pull request at:

https://github.com/apache/zookeeper/pull/137


> 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
>Affects Versions: 3.4.9, 3.5.2
>Reporter: Mohammad Arshad
>Assignee: Edward Ribeiro
> Fix For: 3.4.10, 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)


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

2017-01-25 Thread Hudson (JIRA)

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

Hudson commented on ZOOKEEPER-2573:
---

SUCCESS: Integrated in Jenkins build ZooKeeper-trunk #3250 (See 
[https://builds.apache.org/job/ZooKeeper-trunk/3250/])
ZOOKEEPER-2573: Modify Info.REVISION to adapt git repo (rakeshr: rev 
8771ffdaacb87126a485ae740558f6a288ab980b)
* (edit) src/lastRevision.bat
* (edit) src/java/main/org/apache/zookeeper/Version.java
* (edit) build.xml
* (edit) src/java/main/org/apache/zookeeper/version/util/VerGen.java
* (edit) src/java/test/org/apache/zookeeper/VerGenTest.java
* (edit) src/lastRevision.sh


> 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
>Affects Versions: 3.4.9, 3.5.2
>Reporter: Mohammad Arshad
>Assignee: Edward Ribeiro
> Fix For: 3.4.10, 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)


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

2017-01-25 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ZOOKEEPER-2573:
---

Github user eribeiro commented on the issue:

https://github.com/apache/zookeeper/pull/137
  
@rakeshadr Sure! Doing it right now! Thanks! :+1: 


> 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
>Affects Versions: 3.4.9, 3.5.2
>Reporter: Mohammad Arshad
>Assignee: Edward Ribeiro
> Fix For: 3.4.10, 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)


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

2017-01-25 Thread Rakesh R (JIRA)

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

Rakesh R commented on ZOOKEEPER-2573:
-

Thanks [~eribeiro] for the contribution. Thanks [~hanm], [~arshad.mohammad] for 
the reviews.

Committed to branch-3.4:
https://git-wip-us.apache.org/repos/asf?p=zookeeper.git;a=commit;h=d6bbfd76d24c044073764c5d074a9198c69fafab

Committed to branch-3.5:
https://git-wip-us.apache.org/repos/asf?p=zookeeper.git;a=commit;h=41da3c8e3c39f81aa0f667199c5f4eb3d5a28adc

Committed to master:
https://git-wip-us.apache.org/repos/asf?p=zookeeper.git;a=commit;h=8771ffdaacb87126a485ae740558f6a288ab980b

> 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
>Affects Versions: 3.4.9, 3.5.2
>Reporter: Mohammad Arshad
>Assignee: Edward Ribeiro
> Fix For: 3.4.10, 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)


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

2017-01-25 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ZOOKEEPER-2573:
---

Github user rakeshadr commented on the issue:

https://github.com/apache/zookeeper/pull/137
  
@eribeiro, I have cherry picked the changes to branch-3.4 using #155 pull 
request. Could you please verify the branch-3.4 changes once and close this PR. 
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
>Affects Versions: 3.4.9, 3.5.2
>Reporter: Mohammad Arshad
>Assignee: Edward Ribeiro
> Fix For: 3.4.10, 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)


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

2017-01-25 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ZOOKEEPER-2573:
---

Github user asfgit closed the pull request at:

https://github.com/apache/zookeeper/pull/155


> 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
>Affects Versions: 3.4.9, 3.5.2
>Reporter: Mohammad Arshad
>Assignee: Edward Ribeiro
> Fix For: 3.4.10, 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)


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

2017-01-25 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ZOOKEEPER-2573:
---

Github user eribeiro commented on the issue:

https://github.com/apache/zookeeper/pull/155
  
Thanks for your patience and support @rakeshadr. 

Indeed, I tried to `git apply` the patch: 
https://github.com/apache/zookeeper/pull/155.diff on branch-3.4 and it failed 
as you wrote before. :disappointed:

**Oddly enough**, if I apply this patch to master or branch-3.5 (`git apply 
155.diff`) then switched to branch-3.4 the did a `git cherry-pick ` and 
it worked. But I am suspicious if this was okay (I did a quick test here now).




> 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
>Affects Versions: 3.4.9, 3.5.2
>Reporter: Mohammad Arshad
>Assignee: Edward Ribeiro
> Fix For: 3.4.10, 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)


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

2017-01-25 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ZOOKEEPER-2573:
---

Github user rakeshadr commented on the issue:

https://github.com/apache/zookeeper/pull/155
  
Thanks @eribeiro.
+1 LGTM, I will merge this shortly.


> 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
>Affects Versions: 3.4.9, 3.5.2
>Reporter: Mohammad Arshad
>Assignee: Edward Ribeiro
> Fix For: 3.4.10, 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)


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

2017-01-25 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ZOOKEEPER-2573:
---

Github user eribeiro commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/155#discussion_r97746755
  
--- Diff: src/java/main/org/apache/zookeeper/version/util/VerGen.java ---
@@ -149,11 +150,9 @@ public static void main(String[] args) {
 "Invalid version number format, must be 
\"x.y.z(-.*)?\"");
 System.exit(1);
 }
-int rev;
-try {
-rev = Integer.parseInt(args[1]);
-} catch (NumberFormatException e) {
-rev = -1;
+String rev = args[1];
+if (rev == null || rev.trim().isEmpty()) {
+rev = "-1";
 }
--- End diff --

Oh, really sorry about that. :disappointed: I squashed the commits from 
#137, but for whatever reason this latest change didn't make through. 
:thinking: Well, gonna change now. Thanks for pointing out! 


> 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
>Affects Versions: 3.4.9, 3.5.2
>Reporter: Mohammad Arshad
>Assignee: Edward Ribeiro
> Fix For: 3.4.10, 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)


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

2017-01-25 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ZOOKEEPER-2573:
---

Github user rakeshadr commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/155#discussion_r97743121
  
--- Diff: src/java/main/org/apache/zookeeper/version/util/VerGen.java ---
@@ -149,11 +150,9 @@ public static void main(String[] args) {
 "Invalid version number format, must be 
\"x.y.z(-.*)?\"");
 System.exit(1);
 }
-int rev;
-try {
-rev = Integer.parseInt(args[1]);
-} catch (NumberFormatException e) {
-rev = -1;
+String rev = args[1];
+if (rev == null || rev.trim().isEmpty()) {
+rev = "-1";
 }
--- End diff --

Else block is missing. Could you add rev.trim() function.




> 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
>Affects Versions: 3.4.9, 3.5.2
>Reporter: Mohammad Arshad
>Assignee: Edward Ribeiro
> Fix For: 3.4.10, 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)


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

2017-01-24 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ZOOKEEPER-2573:
---

Github user eribeiro commented on the issue:

https://github.com/apache/zookeeper/pull/137
  
HI @rakeshadr, I have just created a PR targeting branch-3.5 
(https://github.com/apache/zookeeper/pull/155 ). It can be applied to master 
too. In fact, I was able to apply PR 155 to branch-3.4 so you may try to use it 
instead of this one, if you prefer. Otherwise you can squash and merge this one 
on branch-3.4 and 155 on branch-3.5 and master.

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
>Affects Versions: 3.4.9, 3.5.2
>Reporter: Mohammad Arshad
>Assignee: Edward Ribeiro
> Fix For: 3.4.10, 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)


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

2017-01-24 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ZOOKEEPER-2573:
---

GitHub user eribeiro opened a pull request:

https://github.com/apache/zookeeper/pull/155

ZOOKEEPER-2573: Modify Info.REVISION to adapt git repo

@rakeshadr Hi, I have created this PR. The commit can be cherry picked on 
master too.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/eribeiro/zookeeper ZOOKEEPER-2573-3.5

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/zookeeper/pull/155.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #155


commit 7ca175dfadf5220a3495e3e19de4b933df37fc50
Author: Edward Ribeiro 
Date:   2016-12-28T17:21:31Z

ZOOKEEPER-2573: Modify Info.REVISION to adapt git repo




> 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
>Affects Versions: 3.4.9, 3.5.2
>Reporter: Mohammad Arshad
>Assignee: Edward Ribeiro
> Fix For: 3.4.10, 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)


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

2017-01-22 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ZOOKEEPER-2573:
---

Github user rakeshadr commented on the issue:

https://github.com/apache/zookeeper/pull/137
  
+1 latest changes looks good to me. @hanm, @arshadmohammad, could you 
please pitch in and let me know your feedback on latest changes as you have 
reviewed earlier, 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
>Affects Versions: 3.4.9, 3.5.2
>Reporter: Arshad Mohammad
>Assignee: Edward Ribeiro
> Fix For: 3.4.10, 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)


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

2017-01-22 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ZOOKEEPER-2573:
---

Github user eribeiro commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/137#discussion_r97248046
  
--- Diff: src/lastRevision.bat ---
@@ -16,8 +16,9 @@ rem See the License for the specific language governing 
permissions and
 rem limitations under the License.
 
 rem Find the current revision, store it in a file, for DOS
-svn info | findstr Revision > %1
+git rev-parse HEAD > %1
 
-For /F "tokens=1,2 delims= " %%a In (%1) Do (
-   echo lastRevision=%%b> %1
+For /F "tokens=* delims= " %%a In (%1) Do (
--- End diff --

Thanks @arshadmohammad!

I was hoping for some committer/contributor with access to a Windows box to 
help me out with the BAT script. Did you test it?


> 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
>Affects Versions: 3.4.9, 3.5.2
>Reporter: Arshad Mohammad
>Assignee: Edward Ribeiro
> Fix For: 3.4.10, 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)


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

2017-01-22 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ZOOKEEPER-2573:
---

Github user arshadmohammad commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/137#discussion_r97247778
  
--- Diff: src/lastRevision.bat ---
@@ -16,8 +16,9 @@ rem See the License for the specific language governing 
permissions and
 rem limitations under the License.
 
 rem Find the current revision, store it in a file, for DOS
-svn info | findstr Revision > %1
+git rev-parse HEAD > %1
 
-For /F "tokens=1,2 delims= " %%a In (%1) Do (
-   echo lastRevision=%%b> %1
+For /F "tokens=* delims= " %%a In (%1) Do (
--- End diff --

This is not working. May be you can replace with all the script with 
following script:
for /f "delims=" %%i in ('git rev-parse HEAD') do set rev=%%i
echo lastRevision=%rev% > %1


> 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
>Affects Versions: 3.4.9, 3.5.2
>Reporter: Arshad Mohammad
>Assignee: Edward Ribeiro
> Fix For: 3.4.10, 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)


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

2017-01-18 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ZOOKEEPER-2573:
---

Github user eribeiro commented on the issue:

https://github.com/apache/zookeeper/pull/137
  
@rakeshadr I did a couple of changes, including the ones you suggested. 
Please, take a look whenever possible. Cheers!


> 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
>Affects Versions: 3.4.9, 3.5.2
>Reporter: Arshad Mohammad
>Assignee: Edward Ribeiro
> Fix For: 3.4.10, 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)


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

2017-01-18 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ZOOKEEPER-2573:
---

Github user rakeshadr commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/137#discussion_r96649084
  
--- Diff: src/java/main/org/apache/zookeeper/Version.java ---
@@ -20,7 +20,7 @@
 
 public class Version implements org.apache.zookeeper.version.Info {
 
-public static int getRevision() {
+public static String getRevision() {
--- End diff --

I have checked with my HBase colleagues, they said no dependency with 
"revision". From ZK point of view, not required to maintain backward 
compatibility as this is not exposed interface. Still, if any concerns, then we 
can deprecate and create a new GIT_REVISION or REVISION_HASH etc as this change 
will go to stable branch-3.4


> 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
>Affects Versions: 3.4.9, 3.5.2
>Reporter: Arshad Mohammad
>Assignee: Edward Ribeiro
> Fix For: 3.4.10, 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)


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

2017-01-18 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ZOOKEEPER-2573:
---

Github user eribeiro commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/137#discussion_r96636920
  
--- Diff: src/java/main/org/apache/zookeeper/Version.java ---
@@ -20,7 +20,7 @@
 
 public class Version implements org.apache.zookeeper.version.Info {
 
-public static int getRevision() {
+public static String getRevision() {
--- End diff --

@rakeshadr My Google searches didn't bring anything about external  ZK 
revision number use. Of course, many in-house systems can rely on it. So, I am 
clueless about the best strategy here. :(

It would be quite annoying to break internal build tools, but this is an 
unfortunate side effect of a fundamental infra change (VCS). :(

@fpj wdyt?


> 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
>Affects Versions: 3.4.9, 3.5.2
>Reporter: Arshad Mohammad
>Assignee: Edward Ribeiro
> Fix For: 3.4.10, 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)


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

2017-01-17 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ZOOKEEPER-2573:
---

Github user eribeiro commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/137#discussion_r96560786
  
--- Diff: src/lastRevision.sh ---
@@ -16,6 +16,6 @@
 
 # Find the current revision, store it in a file
 FILE=$1
-LASTREV=`svn info | grep '^Revision' | sed -e 's/Revision: *//'`
+LASTREV=`git rev-parse HEAD | cut -c1-8`
--- End diff --

Done.


> 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
>Affects Versions: 3.4.9, 3.5.2
>Reporter: Arshad Mohammad
>Assignee: Edward Ribeiro
> Fix For: 3.4.10, 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)


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

2017-01-17 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ZOOKEEPER-2573:
---

Github user rakeshadr commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/137#discussion_r96560053
  
--- Diff: src/lastRevision.sh ---
@@ -16,6 +16,6 @@
 
 # Find the current revision, store it in a file
 FILE=$1
-LASTREV=`svn info | grep '^Revision' | sed -e 's/Revision: *//'`
+LASTREV=`git rev-parse HEAD | cut -c1-8`
--- End diff --

@eribeiro, could you please update the patch accordingly.


> 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
>Affects Versions: 3.4.9, 3.5.2
>Reporter: Arshad Mohammad
>Assignee: Edward Ribeiro
> Fix For: 3.4.10, 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)


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

2017-01-16 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ZOOKEEPER-2573:
---

Github user eribeiro commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/137#discussion_r96225742
  
--- Diff: src/java/main/org/apache/zookeeper/Version.java ---
@@ -20,7 +20,7 @@
 
 public class Version implements org.apache.zookeeper.version.Info {
 
-public static int getRevision() {
+public static String getRevision() {
--- End diff --

Good question! Um... Maybe we should contact folks at Kafka, HBase and 
other projects for feedback? Anyone has a clue?


> 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
>Affects Versions: 3.4.9, 3.5.2
>Reporter: Arshad Mohammad
>Assignee: Edward Ribeiro
> Fix For: 3.4.10, 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)


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

2017-01-16 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ZOOKEEPER-2573:
---

Github user eribeiro commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/137#discussion_r96225530
  
--- Diff: src/lastRevision.sh ---
@@ -16,6 +16,6 @@
 
 # Find the current revision, store it in a file
 FILE=$1
-LASTREV=`svn info | grep '^Revision' | sed -e 's/Revision: *//'`
+LASTREV=`git rev-parse HEAD | cut -c1-8`
--- End diff --

Hi @rakeskadr, usually the first 8 characters of commit are enough to 
identify the commit.

But I think putting the whole SHA-1 is nice, because the more context the 
better. Also, it simplifies the code even more (to substr the sha1 is annoying 
on windows).

Thanks for pointing out!


> 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
>Affects Versions: 3.4.9, 3.5.2
>Reporter: Arshad Mohammad
>Assignee: Edward Ribeiro
> Fix For: 3.4.10, 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)


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

2017-01-16 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ZOOKEEPER-2573:
---

Github user rakeshadr commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/137#discussion_r96218924
  
--- Diff: src/java/main/org/apache/zookeeper/Version.java ---
@@ -20,7 +20,7 @@
 
 public class Version implements org.apache.zookeeper.version.Info {
 
-public static int getRevision() {
+public static String getRevision() {
--- End diff --

Since this is not an exposed interface it is OK to change the signature. 
But, I'm curious to know that any other project or users depending on the 
revision number.


> 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
>Affects Versions: 3.4.9, 3.5.2
>Reporter: Arshad Mohammad
>Assignee: Edward Ribeiro
> Fix For: 3.4.10, 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)


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

2017-01-16 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ZOOKEEPER-2573:
---

Github user rakeshadr commented on a diff in the pull request:

https://github.com/apache/zookeeper/pull/137#discussion_r96212537
  
--- Diff: src/lastRevision.sh ---
@@ -16,6 +16,6 @@
 
 # Find the current revision, store it in a file
 FILE=$1
-LASTREV=`svn info | grep '^Revision' | sed -e 's/Revision: *//'`
+LASTREV=`git rev-parse HEAD | cut -c1-8`
--- End diff --

Thanks @eribeiro for the patch. Any specific reason to use only the first 8 
characters of the git SHA-1. Will this be helpful in analyzing whether a 
particular fix included in the release?

How about keeping the complete SHA-1?


> 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
>Affects Versions: 3.4.9, 3.5.2
>Reporter: Arshad Mohammad
>Assignee: Edward Ribeiro
> Fix For: 3.4.10, 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)


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

2016-12-28 Thread Edward Ribeiro (JIRA)

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

Edward Ribeiro commented on ZOOKEEPER-2573:
---

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)


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

2016-12-28 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on ZOOKEEPER-2573:
---

GitHub user eribeiro opened a pull request:

https://github.com/apache/zookeeper/pull/137

ZOOKEEPER-2573: Modify Info.REVISION to adapt git repo



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/eribeiro/zookeeper ZOOKEEPER-2573

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/zookeeper/pull/137.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #137


commit c0c0daf3ebee0d280e592a0d262ffc0939f6f762
Author: Edward Ribeiro 
Date:   2016-12-28T17:21:31Z

ZOOKEEPER-2573: Modify Info.REVISION to adapt git repo




> 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
> 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)


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

2016-12-01 Thread Michael Han (JIRA)

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

Michael Han commented on ZOOKEEPER-2573:


bq. I think it is better to change org.apache.zookeeper.version.Info.REVISION 
from int to String and store the git revision.

+1 on the idea. [~arshad.mohammad], are you still interested working on a fix 
for this issue? If so, please go ahead and submit a pull request, so we can get 
this in for 3.5.3.


> 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
> 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)


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

2016-09-14 Thread Arshad Mohammad (JIRA)

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

Arshad Mohammad commented on ZOOKEEPER-2573:


revision gives very good information in analyzing whether a particular fix 
included in the build, specially in private builds. If we have option to remove 
this , we definitely have option to change it. I think it is better to change 
{{org.apache.zookeeper.version.Info.REVISION}} from int to String and store the 
git revision.
[~phunt] shall I submit the patch for this?

> 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
> 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)


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

2016-09-09 Thread Arshad Mohammad (JIRA)

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

Arshad Mohammad commented on ZOOKEEPER-2573:


# shall we modify {{org.apache.zookeeper.version.Info.REVISION}} from int to 
String and store the git revision in it
 or introduce new variable {{org.apache.zookeeper.version.Info.GIT_REVISION}} 
for git revision?
# I would prefer to modify it from int to String, if there is no backward 
compatibility concern. It is not an exposed interface, so backward 
compatibility should be a concern here.

Any thoughts ?

> 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
>
> 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)


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

2016-09-09 Thread Patrick Hunt (JIRA)

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

Patrick Hunt commented on ZOOKEEPER-2573:
-

Perhaps we should simplify and just remove revision?

> 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
>
> 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)