Comments (12)
Then there must be something else wrong on your local setup. jgit appears to be reporting that it cannot find your working file tree.
Note that the implementation in this project matches published jgit documentation and FileRepositoryBuilder
is an ordinary, public, non-deprecated class.
from gradle-android-git-version.
This is good but it break's everyone's favorite git feature: submodules. I'm looking into this.
from gradle-android-git-version.
I think the real problem above may be that some aspect of your hooks is operating without access to the .git tree, causing RepositoryNotFoundException which is not caught.
In this case, androidGitVersion can print a warning message and continue.
from gradle-android-git-version.
@Ferrugemm this is now published in 0.4.14; if this doesn't work please let me know or reopen.
from gradle-android-git-version.
Hey @gladed, thanks for the attention and the upgrades, but still don't working :(
The stacktrace from my machine (Linux 18.04 LTS)
~/AndroidStudioProjects/<project> <branch>/gladed-plugin ✚ git commit -m "new version of gladed plugin v0.4.14"
1: Task failed with an exception.
-----------
* Where:
Script '/.../<file>.gradle' line: 10
* What went wrong:
A problem occurred evaluating script.
> Bare Repository has neither a working tree, nor an index
I made the modification above and generated the local .jar and it works to me.
from gradle-android-git-version.
Can I reproduce this locally? What kind of a hook is installed?
from gradle-android-git-version.
Yes, you can!
It is pre-commit hooks and basically make auto check of my project.
This article drives the setup process: https://medium.com/@alistair.cerio/android-ktlint-and-pre-commit-git-hook-5dd606e230a9
Besides that, i've your plugin configured in app/build.gradle
, with .name
and the .code
.
from gradle-android-git-version.
Here's what I did, and it worked. Are you sure the repo you're working from is present and not bare? Or is this a result you're only getting from CI on a server?
$ cat >.git/hooks/pre-commit
#!/bin/bash
git stash -q --keep-index
./gradlew androidGitVersion
RESULT=$?
git stash pop -q
# return 1 exit code if running checks fails
[ $RESULT -ne 0 ] && exit 1
exit 0
^D
$ chmod a+x .git/hooks/pre-commit
$ git commit -m "temp" --allow-empty
...
> Task :...:androidGitVersion
androidGitVersion.name 1.2.3
androidGitVersion.code 1002003
BUILD SUCCESSFUL in 1s
5 actionable tasks: 5 executed
[master 98c6276f] temp
from gradle-android-git-version.
@gladed yes, it is my local machine and repo :(
How can i verify the not bare repository?
from gradle-android-git-version.
https://stackoverflow.com/questions/1830701/how-do-i-check-if-a-repository-is-bare
from gradle-android-git-version.
From my .sh and terminal:
$ git rev-parse --is-bare-repository
The result is false
from gradle-android-git-version.
Thanks @gladed 😄
from gradle-android-git-version.
Related Issues (20)
- Replace untrackedIsDirty with format extension
- Use --first-parent strategy
- Match git-describe commit hash
- Document git-describe format HOT 1
- Changelog HOT 1
- Describe output is empty? HOT 5
- Clean up testNearestTag test
- Recent update of jgit breaks compatibility with older Gradle versions HOT 1
- .. HOT 1
- [question] Support for incremental versionCode separately from versionName? HOT 6
- Different format per buildType? HOT 2
- Include proper task descriptions
- Add direct access to components
- Nearest tag with optional tagPattern
- Unable to download jgit from jcenter
- It's keep saying untagged even though I already did
- Allow different format for non-tagged version
- androidGitVersion triggering an exception on a new fork without any tag yet HOT 1
- External process issue with gradle configuration cache enabled HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gradle-android-git-version.