Giter VIP home page Giter VIP logo

Comments (2)

davidalpert avatar davidalpert commented on June 12, 2024 1

it looks like the functionality I'm looking for is already present in this method https://github.com/git-chglog/git-chglog/blob/v0.15.4/chglog.go#L226-L253

there is no real reason that I can tell for this readUnreleased(..) method to take in a slice of *Tag; if instead we pushed the responsibility for forming the rev list out so that this method could accept any rev list, that would probably move us towards being able to generate release fragments for an arbitrary range of commits by standard git ref syntax.

func (gen *Generator) readUnreleased(tags []*Tag) (*Unreleased, error) {
	if gen.config.Options.NextTag != "" {
		return &Unreleased{}, nil
	}

	rev := "HEAD"

	if len(tags) > 0 {
		rev = tags[0].Name + "..HEAD"
	}

	commits, err := gen.commitParser.Parse(rev)
	if err != nil {
		return nil, err
	}

	commitGroups, mergeCommits, revertCommits, noteGroups := gen.commitExtractor.Extract(commits)

	unreleased := &Unreleased{
		CommitGroups:  commitGroups,
		Commits:       commits,
		MergeCommits:  mergeCommits,
		RevertCommits: revertCommits,
		NoteGroups:    noteGroups,
	}

	return unreleased, nil
}

maybe supporting generating unreleased notes about any arbitrary commits while still requiring tags to be in use for the standard use case is a nice compromise?

from git-chglog.

davidalpert avatar davidalpert commented on June 12, 2024

@mavogel @wadackel I would also like to generate changelog notes based on a pair of commit references, in my case the head and base refs of a Pull Request

my use case is to generate a release note fragment in a pull request based just on the changes in that pull request as a way to provide feedback to the developers on my team how their commit messages will render in the customer-facing release notes we intend to generate later (based on tags in our release branch).

if this capability is aligned with this project's goals and vision I would be willing to prepare a contribution to implement.

I look forward to your thoughts and direction.

from git-chglog.

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.