Git Product home page Git Product logo

Comments (6)

metcalfc avatar metcalfc commented on August 24, 2024 1

I'm good with the parameter to fetch or not. We can default fetch to true so it doesn't break existing users. You and others that want to use slash or other things can set fetch to false and everyone is off to the races.

from changelog-generator.

metcalfc avatar metcalfc commented on August 24, 2024

Hey,

I dug into this. There might be a way but I don't have the git internals knowledge to get it to work. So here is what is happening:

  • GitHub Actions are shallow checkouts of just the branch in question
  • The action "unshallows" the checkout so we've got access to all the tags and branch names.
    git fetch --depth=1 origin +refs/tags/*:refs/tags/* 1>&2
    git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/* 1>&2
    git fetch --prune --unshallow 1>&2
  • Branches with slashes are never realized in that. I'm not sure why.

If you have the magic incantation needed to unshallow a checkout and pull in branches with slashes happy to fix it.

To test this I set a branch test/branch to v0.0.2 and ran the action. This is the error:

fatal: ambiguous argument ''v0.0.1...test/branch'': unknown revision or path not in the working tree.

So one would probably have to check if the refs have slashes and then pull all the refs in that directory but this is beyond my git foo.

from changelog-generator.

metcalfc avatar metcalfc commented on August 24, 2024

Just in case someone wants to pick up where I left off https://github.com/metcalfc/changelog-generator/tree/slash_branch has the last patch I tried.

from changelog-generator.

nielstenboom avatar nielstenboom commented on August 24, 2024

Thanks for having a look!

I took a stab at getting it to work as well and got it to work (sorta.. 😅 )

It can work with 2 gotchas:

  1. Have the checkout action do all the fetching lifting, so add fetch-depth: 0 and don't have this action do any fetching (see here for the bash file)
  2. Add origin/ in front of the ref that has a / in it, with that the git log ... works (no clue about the git foo underneath)

See here for a succesful run.

So to fix this we could maybe add a parameter to this action to enable fetching or not, sth like fetch: false and then in the readme add that you should put origin in front of branch name refs with forward slashes in them?

from changelog-generator.

github-actions avatar github-actions commented on August 24, 2024

This issue has not had any activity in 30 days. Marking it stale. It will be closed in 14 days.

from changelog-generator.

metcalfc avatar metcalfc commented on August 24, 2024

Merged in #188

from changelog-generator.

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.