Skip to content

Conversation

brewkode
Copy link
Contributor

Some teams do not expect a version bump when a README gets updated with a docs prefix commit or a style change.
To allow that flexibility, this commit introduces a commit-prefix flag that can take multiple values to filter out commit logs before being used to calculate the next semver

Some teams do not expect a version bump when a README gets updated with a docs prefix commit or a style change.
To allow that flexibility, this commit introduces a commit-prefix flag that can take multiple values to filter out commit logs before being used to calculate the next semver
@brewkode
Copy link
Contributor Author

@caarlos0 Please see if you want to merge this :)

@brewkode
Copy link
Contributor Author

@caarlos0 Checking in again. Would you be interested to merge this ?

@caarlos0 caarlos0 merged commit 283525f into caarlos0:master Nov 17, 2021
@caarlos0
Copy link
Owner

sorry, totally missed this

@caarlos0
Copy link
Owner

thanks for the pr!

@@ -40,3 +41,29 @@ func FindNext(current *semver.Version, forcePatchIncrement bool, log string) sem

return *current
}

func FilterCommits(log string, prefixes []string) string {
lines := strings.Split(log, "\n")
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't really work, as commit msgs are multi-lined 🤔

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will revert this for now

caarlos0 added a commit that referenced this pull request Nov 19, 2021
hbk619 added a commit to hbk619/svu that referenced this pull request Oct 25, 2022
Svu searches across the entire git log for commits which is inconvenient when
there are multiple packages in one repo (a monorepo). There are a  few ways we
could handle this:

* We could filter commit messages by a specific prefix, which requires users to
  use the prefix in their commits and as commits are multiple lines[1] is more
  complicated to implement than first seems
* We could add the files to the commit log and search through that, but again is
 more complicated than it seems
* Use git logs ability to filter by directory (this commit)
* some other idea I've not thought of

  [1] caarlos0#45
hbk619 added a commit to hbk619/svu that referenced this pull request Oct 26, 2022
Svu searches across the entire git log for commits which is inconvenient when
there are multiple packages in one repo (a monorepo). There are a  few ways we
could handle this:

* We could filter commit messages by a specific prefix, which requires users to
  use the prefix in their commits and as commits are multiple lines[1] is more
  complicated to implement than first seems
* We could add the files to the commit log and search through that, but again is
 more complicated than it seems
* Use git logs ability to filter by directory (this commit)
* some other idea I've not thought of

  [1] caarlos0#45
hbk619 added a commit to hbk619/svu that referenced this pull request May 10, 2023
Svu searches across the entire git log for commits which is inconvenient when
there are multiple packages in one repo (a monorepo). There are a  few ways we
could handle this:

* We could filter commit messages by a specific prefix, which requires users to
  use the prefix in their commits and as commits are multiple lines[1] is more
  complicated to implement than first seems
* We could add the files to the commit log and search through that, but again is
 more complicated than it seems
* Use git logs ability to filter by directory (this commit)
* some other idea I've not thought of

  [1] caarlos0#45
caarlos0 pushed a commit that referenced this pull request May 10, 2023
Svu searches across the entire git log for commits which is inconvenient when
there are multiple packages in one repo (a monorepo). There are a  few ways we
could handle this:

* We could filter commit messages by a specific prefix, which requires users to
  use the prefix in their commits and as commits are multiple lines[1] is more
  complicated to implement than first seems
* We could add the files to the commit log and search through that, but again is
 more complicated than it seems
* Use git logs ability to filter by directory (this commit)
* some other idea I've not thought of

  [1] #45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants