Giter VIP home page Giter VIP logo

Comments (7)

domroutley avatar domroutley commented on May 27, 2024 1

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.

jacob-meacham avatar jacob-meacham commented on May 27, 2024

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.

laurrentt avatar laurrentt commented on May 27, 2024

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.

jacob-meacham avatar jacob-meacham commented on May 27, 2024

@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.

laurrentt avatar laurrentt commented on May 27, 2024

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.

jacob-meacham avatar jacob-meacham commented on May 27, 2024

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.

jacob-meacham avatar jacob-meacham commented on May 27, 2024

@domroutley nope, that sounds excellent!

from serverless-plugin-git-variables.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.