Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create a toolchain for git #257

Closed
aiuto opened this issue Nov 6, 2020 · 2 comments · Fixed by #357
Closed

create a toolchain for git #257

aiuto opened this issue Nov 6, 2020 · 2 comments · Fixed by #357
Assignees
Labels
p4 An idea that we are not considering working on at this time.
Milestone

Comments

@aiuto
Copy link
Collaborator

aiuto commented Nov 6, 2020

This would be only for internal use, and not part of the supported public API

  • it is needed by tools that generate changelogs
  • It could be used in the examples for workspace naming so that you can get git commit into a file name.
@aiuto aiuto added the P2 An issue that should be worked on when time is available label Nov 6, 2020
@aiuto aiuto added P3 An issue that we are not working on but will review quarterly and removed P2 An issue that should be worked on when time is available labels Feb 24, 2021
@aiuto aiuto self-assigned this Mar 4, 2021
@aiuto
Copy link
Collaborator Author

aiuto commented Mar 4, 2021

An alternative would be to have a rules_git repo that defines the toolchain and then has rules to provide various features for extracting git metadata into a build. I rejected that because

  • that might introduce dependencies on yet another language
  • we would still have to write tools to modify the output of those rules into things we can use
  • owning rules_git would be a thankless job where there are unbounded external demands for features, with little computation of value behind it. That is, I do not believe anyone would want to own it.

@aiuto
Copy link
Collaborator Author

aiuto commented May 3, 2021

This gets ugly quick. We can get the path to git, but we can't force a rule to run with the working directory.
So, the best we can do is make a rule like //distro:update_changes, which you must bazel run, rather than build. Or, perhaps we can generate a script that you then run, like:

$ bazel build :update_changelog.sh
$ bazel-bin/update_changelog.sh
... updates CHANGELOG

But, if we are going to have to run update_changelog.sh, why do we need to detect git. Let's just use what the user is using.

@aiuto aiuto removed their assignment May 4, 2021
@aiuto aiuto added p4 An idea that we are not considering working on at this time. and removed P3 An issue that we are not working on but will review quarterly help wanted labels May 4, 2021
aiuto added a commit to aiuto/rules_pkg that referenced this issue May 28, 2021
…e that to start the release notes.

Warning: This is experimental.

- Add a git toolchain
  - It gets the path to the git binary and the path to your source tree
  - therefore it can only be used locally.
  - Fixes bazelbuild#257
- Add a `git_changelog()` rule that will run git to get the change log.
  - Advances bazelbuild#228
- Change print_relnotes to accept a changelog file, instead of running git locally.

Next steps:
- Add the capability to reduce the change log from everything to only
  the commits that have RELNOTES sections.
@aiuto aiuto self-assigned this Jun 8, 2021
@aiuto aiuto added this to the 1.0 milestone Jun 9, 2021
aiuto added a commit to aiuto/rules_pkg that referenced this issue Jun 29, 2021
…e that to start the release notes.

Warning: This is experimental.

- Add a git toolchain
  - It gets the path to the git binary and the path to your source tree
  - therefore it can only be used locally.
  - Fixes bazelbuild#257
- Add a `git_changelog()` rule that will run git to get the change log.
  - Advances bazelbuild#228
- Change print_relnotes to accept a changelog file, instead of running git locally.

Next steps:
- Add the capability to reduce the change log from everything to only
  the commits that have RELNOTES sections.
@aiuto aiuto closed this as completed in #357 Jul 6, 2021
aiuto added a commit that referenced this issue Jul 6, 2021
)

Add capability to gather the commit log since the last release and use that to start the release notes.

Warning: This is experimental.

- Add a git toolchain
  - It gets the path to the git binary and the path to your source tree
  - therefore it can only be used locally.
  - Fixes #257
- Add a `git_changelog()` rule that will run git to get the change log.
  - Advances #228
- Change print_relnotes to accept a changelog file, instead of running git locally.

Next steps:
- Add the capability to reduce the change log from everything to only
  the commits that have RELNOTES sections.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p4 An idea that we are not considering working on at this time.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant