Comments (7)
Hey, I also use lightweight tags, being able to visually grep my functions by Github releases/tags would be really useful.
The output of git describe --always --tags
(combined with the branch name) is what I want in the function description.
Both having a lightweightTag
variable or a toggle between lightweight and annotated tags would work.
However the variable would enable people to use both annotated and lightweight tags if they wished.
@jacob-meacham would you have a problem with me opening a PR to implement the lightweightTag
variable?
from serverless-plugin-git-variables.
Hi @laurrentt thanks for the report - however, I'm not seeing the behavior you're describing on my mac -
In a repo with tags
$ git checkout master
$ git describe --always
3.0.0
$ git checkout develop
$ git describe --always
3.0.0-2-g175974e
In a repo without tags:
$ git describe --always
df57d9d
This could possibly be caused by a git version mismatch - I'm running git version 2.15.1. Thanks!
from serverless-plugin-git-variables.
Hi @jacob-meacham, thx for taking the time to reply to my issue 😄
I've found why we don't have the same output with the same command here: https://stackoverflow.com/a/4154518/970247. In short, I'm using GitHub releases to create my tags. It creates lightweight tags (instead of annotated ones) which can't be seen with only git describe --always
, it needs the --tags
to consider lightweights tags.
I think adding the --tags
flag would not change the actual behaviour for annotated tags but would allow me to get the proper output with GitHub created tags.
What do you think?
from serverless-plugin-git-variables.
@laurrentt this change will potentially alter behavior for others (if they're using both light and annotated tags) - can we hide it behind a flag (default off) for now? When I next make a breaking release, I'll change the flag to default true.
Thanks!
from serverless-plugin-git-variables.
Yes you're absolutely right, I didn't think it through. I think considering this, even after making a breaking change, this could still be a problem for current users. Would you consider making a new variable called something like lightweightTag that would execute git describe --always --tags
?
Thanks again for taking the time to answer
from serverless-plugin-git-variables.
I think I'd prefer adding a config point for this instead of a different git variable - for a particular project, it seems unlikely to me that someone would want both behaviors. So something like:
custom:
gitConsiderLightweightTags: true
and then default it to false
from serverless-plugin-git-variables.
@domroutley nope, that sounds excellent!
from serverless-plugin-git-variables.
Related Issues (20)
- Add client-side validation of git variables
- Support adding `-match <pattern>` when calling git describe
- if there is no git user, using `${git:user}` kills the deploy
- Injected variables not included in `serverless print` HOT 2
- Refactor to use NodeGit HOT 1
- Release 3.3.0 fails with invalid git command HOT 5
- sporadic git command failed "git write-tree" HOT 15
- Git Command Fails - Suspected Timeout HOT 4
- Wrong values in env vars HOT 3
- "Rejects on bad git command" test fails
- Document isDirty HOT 1
- Display GIT_USER and GIT_EMAIL by default HOT 1
- Failing build when more then one tag points to commit HOT 4
- GIT_USER and GIT_EMAIL are not exported by default HOT 2
- Old version of babel-runtime with deprecated core-js HOT 4
- Feature request: Add support for commit subject HOT 1
- Staged changes are not counted as 'dirty' by git:isDirty HOT 1
- Approached unrecognized configuration variable sources: "git". HOT 7
- Not works for Windows HOT 1
- Integration with Serverless Framework v3 HOT 3
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 serverless-plugin-git-variables.