Comments (5)
I've been thinking more about this and I think, whether you're using git-flow or not, that a "mergeback" from your release branch into your master is a good idea.
In some cases, people make "hotfixes" to the release branch, and those need to be merged back into the mainline development branch anyhow. Once you've done this, android-git-version will be able to reach the most recent tagged commit, and will give you good version names.
Another way to do it is to tag your develop branch with the next version code pre-emptively.
For example:
develop: a --> b --> d (1.1-dev) ---------> f
master: \--> c (1.0) --> e (1.0.1) \--> g (1.1)
Commit f
will be called 1.1-dev-1
or something like it.
from gradle-android-git-version.
The best solution I have is tagPattern
. It does require that on your master's build.gradle
you modify the tagPattern
once per major release.
Open to other ideas if anyone has them; it's a fundamental git limitation that the branch doesn't remember which commits it used to be on, only the commit it's on at the present time.
from gradle-android-git-version.
Note: I was able to work around the git-flow limitation by merging master
into develop
so that the tag ancestry was developed.
git fetch
git checkout develop
git merge master
Still wondering if there are any other "best practices" that I could apply when using git-flow. If not, feel free to close this issue.
from gradle-android-git-version.
Best practice: http://endoflineblog.com/gitflow-considered-harmful 😄
But seriously I'm glad you found a workaround. "Vanilla" git-flow doesn't have the tag in the necessary commit histories, as you observed, and I think your workaround is good.
from gradle-android-git-version.
I know this is quite old, but I'm hitting this problem right now.
Taking into account a similar case as the one described:
develop: a --> b --> d (1.1) -----------------m--> f
master: \--> c (1.0) --> e (1.0.1) --/ \--> g (1.1)
If there's a merge from master back to develop, then on commit f
will be named 1.0
, however using git describe
the result is 1.1
.
Is this the expected behaviour? If it is do you have any kind of workaround - besides a new tag on develop?
from gradle-android-git-version.
Related Issues (20)
- Remove deprecated items
- Replace commitHashLength with format extension
- 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
- Bare Repository has neither a working tree, nor an index via execution of git hooks HOT 12
- 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
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.