Coder Social home page Coder Social logo

Comments (7)

josevalim avatar josevalim commented on August 15, 2024

Can we ask Git if we are inside a current tag? It would be nice if we could get this automatically but we'd need command line options too. :)

from ex_doc.

alco avatar alco commented on August 15, 2024

What do you mean? Tag just points to a commit. Do you want to automatically find out whether the current commit is tagged? Not sure if that'll help.

The use case for most projects would be to specify the url pattern that includes a specific tag/branch. BTW, we could make it easier for users like we do currently with :github in url patterns (it only supports master now IIRC).

For Elixir, do you manually generate the docs by checking out a specific commit? Then you could do:

λ git checkout v0.8.2
# ...

λ git describe --all `git rev-parse HEAD`
tags/v0.8.2

λ git describe --tags `git rev-parse HEAD`
v0.8.2
λ git checkout master
# ...

λ git describe --tags `git rev-parse HEAD`
v0.8.2-95-ga0787fb

λ git describe --all `git rev-parse HEAD` 
heads/master

from ex_doc.

josevalim avatar josevalim commented on August 15, 2024
λ git describe --tags `git rev-parse HEAD`
tags/v0.8.2

This is exactly what I had in mind. Get the current commit and check: is it in a tag? If so, use the tag, if not, use the commit hash itself. What do you think?

from ex_doc.

alco avatar alco commented on August 15, 2024

To be clear, git describe --all <hash> could output multiple lines, if the commit hash is pointed to by multiple refs.

Get the current commit and check: is it in a tag?

Hm, I don't think it's our decision to make. Technically, only commit hash will provide 100% reliability in the presence of changes. But the commit itself may become orphan after a force push.

I think the user has to decide. We can provide a shortcut for generating source links based on the current/commit tag in the config options (similar to current :github). But there has to be a config option for this the that user sets explicitly.

from ex_doc.

josevalim avatar josevalim commented on August 15, 2024

@alco is this fixed after you added the ability to specify a commit/branch/tag or not yet?

from ex_doc.

alco avatar alco commented on August 15, 2024

Both master and stable point to v0.9.2. I thought master should point to a specific commit which was master at the time of doc generation.

from ex_doc.

josevalim avatar josevalim commented on August 15, 2024

This is because I haven't generating anything from master after v0.9.2. :) I just generated it now and everything worked like a charm, thanks @alco!

from ex_doc.

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.