[
https://issues.apache.org/jira/browse/LUCENE-6938?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15075879#comment-15075879
]
Dawid Weiss commented on LUCENE-6938:
-------------------------------------
Hi. Catching up with what's been said, here's my opinion.
1) I didn't go into the specific of what the scripts were doing to get a
"pristine" copy of a built, but with git you can do {{git-archive}} to get a
tarball without any intermediate filesystem index. This has advantages for
Windows (permissions are stored properly) and for speed (much faster on slower
filesystems). Perhaps the scripts could be improved and do a two-phase check:
{{git stat}} to verify the current checkout isn't dirty (locally ignored files
remain ignored) and then create a tarball, from which all the tests, etc. would
be executed in any follow-up steps.
https://git-scm.com/docs/git-archive
1) I strongly opt for keeping the commit's md5 inside build artefacts. This has
helped me enormously in the past a few times. These hashes are not linear,
correct, but they are even better at locating a particular commit the build was
executed against, be it a branch or whatever. We personally use two git markers
-- the commit hash and a more human-friendly last-tag + dirty flag. We call
{{jgit}} from ant, but here's the beanshell script that collects the required
properties:
{code}
import org.eclipse.jgit.api.*;
import org.eclipse.jgit.lib.*;
import org.eclipse.jgit.storage.file.*;
Repository repository = new FileRepositoryBuilder()
.findGitDir(project.getBaseDir())
.build();
Git git = new Git(repository);
String revLine =
git.log().setMaxCount(1).call().iterator().next().name() +
(git.status().call().isClean() ? "" : "-dirty");
project.setNewProperty("product.gitrev", revLine);
{code}
> Convert build to work with Git rather than SVN.
> -----------------------------------------------
>
> Key: LUCENE-6938
> URL: https://issues.apache.org/jira/browse/LUCENE-6938
> Project: Lucene - Core
> Issue Type: Task
> Reporter: Mark Miller
> Assignee: Mark Miller
> Attachments: LUCENE-6938.patch
>
>
> We assume an SVN checkout in parts of our build and will need to move to
> assuming a Git checkout.
> Patches against https://github.com/dweiss/lucene-solr-svn2git from
> LUCENE-6933.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]