Coder Social home page Coder Social logo

Comments (6)

jkloetzke avatar jkloetzke commented on July 17, 2024

This was actually a glitch which got silently fixed with this commit. It should have never worked and actually never has on a Jenkins. There "tags/" was already added since the beginning.

If I understand correctly you have a multiPackage where you set a variable that is used for the common checkoutSCM. This variable could point to any tag, branch or commit? In this case we could introduce a new "ref" property. It could have the following format and that would unify the "branch", "tag" and "commit" properties:

  • -> commit
  • refs/heads/ -> branch
  • refs/tags/ -> tag

Would that match your use case?

from bob.

kolewu avatar kolewu commented on July 17, 2024

Yes.

I've tried to remember what the reason was, we are using tag: -- maybe it was, because branch: didn't had the error. But isn't there a different behavior for tag: and branch:? Such as branch: always updating and tag not because a tag is deterministic?

from bob.

jkloetzke avatar jkloetzke commented on July 17, 2024

Good point. That is an important distinction that I forgot.

I'll prepare a prototype. Not sure that I'll have it ready this week, though.

from bob.

jkloetzke avatar jkloetzke commented on July 17, 2024

I've pushed a prototype of the new 'rev' property to a topic branch (git-scm-rev-property). It implements a new property that unifies the branch/tag/commit properties. It does retain all properties of the existing ones, e.g. "refs/tags/..." is considered deterministic. The documentation is also available on the branch.

Could you please have a look if it works for you? If yes I would add some more unit tests and merge the feature.

from bob.

kolewu avatar kolewu commented on July 17, 2024

I have tested the prototype and it works for what we are doing.

If you had created a (WIP)-Pull-Request, it would have been easier to comment on the code ...

I don't think it's a good idea to only accept commit-IDs of full length:

            rev = spec["rev"]
            if rev.startswith("refs/heads/"):
                self.__branch = rev[11:]
            elif rev.startswith("refs/tags/"):
                self.__tag = rev[10:]
            elif len(rev) == 40:
                self.__commit = rev
            else:
                raise ParseError("Invalid rev format: " + rev)

The following test for hex numbers is sufficient as far as I am concerned.

from bob.

jkloetzke avatar jkloetzke commented on July 17, 2024

Cool. A pull request would certainly have made it easier. I will add some test and merge it...

Regarding the commit-ID: even though git accepts prefixes of commit IDs they have to be unambiguous. This depends on the context. One could argue that >64bits of commit ID are unique enough but I'm not sure where to draw the line. I would like to keep the full commit id for that reason. BTW, the regex is testing for 40 characters too.

from bob.

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.