forked from desktop/dugite-native
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
137 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,32 @@ | ||
# Contributing to `dugite-native` | ||
|
||
As these scripts are dependent on the OS you have setup, I've not spent much | ||
time testing things out about the local development experience. | ||
[fork]: https://github.com/desktop/dugite-native/fork | ||
[pr]: https://github.com/desktop/dugite-native/compare | ||
[code-of-conduct]: CODE_OF_CONDUCT.md | ||
[documentation]: docs/making-changes.md | ||
|
||
## Setup | ||
Hi there! We're thrilled that you'd like to contribute to this project. Your help is essential for keeping it great. | ||
|
||
You'll need a bash environment to run these scripts, and you should be able | ||
to emulate the behaviour of Travis by setting environment variables | ||
Please note that this project is released with a [Contributor Code of Conduct][code-of-conduct]. By participating in this project you agree to abide by its terms. | ||
|
||
``` | ||
GIT_LFS_URL=https://github.com/git-lfs/git-lfs/releases/download/v1.5.5/git-lfs-darwin-amd64-1.5.5.tar.gz \ | ||
GIT_LFS_CHECKSUM=2227668c76a07931dd387602f67c99d5d42f0a99c73b76f8949bbfe3a4cc49c7 \ | ||
script/build-macos.sh ./git /tmp/build/git/ | ||
``` | ||
## Submitting a pull request | ||
|
||
Please :thumbsup: this issue https://github.com/desktop/dugite-native/issues/26 | ||
if you encounter friction with running things locally and would like it to be | ||
easier. | ||
0. [Fork][fork] and clone the repository | ||
0. Look over the [documentation][documentation] on how and where to make changes | ||
0. Create a new branch: `git checkout -b my-branch-name` | ||
0. Make your change | ||
0. Push to your fork and [submit a pull request][pr] | ||
0. Pat your self on the back and wait for your pull request to be reviewed and merged. | ||
|
||
## Updating Git | ||
Here are a few things you can do that will increase the likelihood of your pull request being accepted: | ||
|
||
Ensure the submodule is checked out to the correct tag, e.g: | ||
|
||
``` | ||
cd git | ||
git checkout v2.11.1 | ||
``` | ||
|
||
The package scripts will look for this tag, so non-tagged builds are not | ||
currently supported. Committing this submodule change and publish a pull | ||
request to initiate the build scripts. | ||
|
||
## Changing how Git is built | ||
|
||
Refer to the build scripts under the `script` folder for how we are building Git for each platform: | ||
|
||
- [Windows](https://github.com/desktop/dugite-native/blob/master/script/build-win32.sh) | ||
- [macOS](https://github.com/desktop/dugite-native/blob/master/script/build-macos.sh) | ||
- [Ubuntu](https://github.com/desktop/dugite-native/blob/master/script/build-ubuntu.sh) | ||
|
||
Ideally we should be using the same flags wherever possible, but sometimes we | ||
need to do platform-specific things. | ||
|
||
Windows doesn't need to be built from source, however it should be updated in step with the other Git releases. When a new [Git for Windows](https://github.com/git-for-windows/git) release is made available, just update the | ||
`GIT_FOR_WINDOWS_URL` and `GIT_FOR_WINDOWS_CHECKSUM` variables in `.travis.yml` | ||
to use their MinGit build. | ||
|
||
## Updating Git LFS | ||
|
||
Packages are published for each platform from the [Git LFS](https://github.com/git-lfs/git-lfs) | ||
repository. These are defined as environment variables in the `.travis.yml` - | ||
update the `GIT_LFS_URL` and `GIT_LFS_CHECKSUM` for all platforms and commit | ||
the change. | ||
- Keep your change as focused as possible. If there are multiple changes you would like to make that are not dependent upon each other, consider submitting them as separate pull requests. | ||
- Write a [good commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html). | ||
- In your pull request description, provide as much detail as possible. This context helps the reviewer to understand the motivation for and impact of the change. | ||
|
||
## Resources | ||
|
||
- [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/) | ||
- [Contributing to Open Source on GitHub](https://guides.github.com/activities/contributing-to-open-source/) | ||
- [Using Pull Requests](https://help.github.com/articles/about-pull-requests/) | ||
- [GitHub Help](https://help.github.com) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Documentation | ||
|
||
- [Overview](./overview.md) - introduces how the repository and scripts work | ||
- [Making Changes](./making-changes.md) - a deeper introduction in the scripts and how to contribute changes | ||
- [Setup](./setup.md) - details about setting things up for local development |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Making Changes | ||
|
||
To improve the `dugite-native` toolchain, just find the appropriate hook. | ||
|
||
## Update Git | ||
|
||
If you want to incorporate a new version of Git, first ensure the submodule is | ||
checked out to the correct tag, e.g: | ||
|
||
``` | ||
cd git | ||
git checkout v2.11.1 | ||
``` | ||
|
||
The package scripts will look for this tag, so non-tagged builds are not | ||
currently supported. Commit this submodule change and publish a pull request | ||
to test the packaging changes. | ||
|
||
## Change how Git is built | ||
|
||
Refer to the build scripts under the `script` folder for how we are building | ||
Git for each platform: | ||
|
||
- [Windows](https://github.com/desktop/dugite-native/blob/master/script/build-win32.sh) | ||
- [macOS](https://github.com/desktop/dugite-native/blob/master/script/build-macos.sh) | ||
- [Ubuntu](https://github.com/desktop/dugite-native/blob/master/script/build-ubuntu.sh) | ||
|
||
Ideally we should be using the same flags wherever possible, but sometimes we | ||
need to do platform-specific things. | ||
|
||
Windows doesn't need to be built from source, however it should be updated in | ||
step with the other Git releases. When a new [Git for Windows](https://github.com/git-for-windows/git) | ||
release is made available, just update the `GIT_FOR_WINDOWS_URL` and | ||
`GIT_FOR_WINDOWS_CHECKSUM` variables in `.travis.yml` to use their MinGit | ||
build. | ||
|
||
## Update Git LFS | ||
|
||
Packages are published for each platform from the [Git LFS](https://github.com/git-lfs/git-lfs) | ||
repository. These are defined as environment variables in the `.travis.yml` - | ||
update the `GIT_LFS_URL` and `GIT_LFS_CHECKSUM` for all platforms and commit | ||
the change. | ||
|
||
## Add a new component | ||
|
||
If there is some component you think should be incorporated into this package, | ||
please [open a new issue](https://github.com/desktop/dugite/issues/new) with | ||
as much detail as possible about what the package is and why you think it is | ||
valuable. | ||
|
||
If the maintainers agree that this is a worthy addition, you are | ||
then welcome to contribute a pull request to incorporate this. Note that this | ||
package is intended to be as lean as possible, so make a good case for it! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Setup | ||
|
||
As these scripts are dependent on the OS you have setup, I've not spent much | ||
time testing things out about the local development experience. Please | ||
:thumbsup: [this issue](https://github.com/desktop/dugite-native/issues/26) | ||
if you encounter friction with running things locally and would like it to be | ||
easier. | ||
|
||
### Requirements | ||
|
||
As this project depends on the toolchain you have installed, you will also need access to the same operating system you wish to compile Git for. Currently we don't need to build from source on Windows, but for macOS we do need access to the XCode toolchain. You also need a bash environment to run these scripts. | ||
|
||
### Testing | ||
|
||
You should be able to emulate the behaviour of Travis by setting environment variables. For example, to package for macOS you could run this: | ||
|
||
``` | ||
GIT_LFS_URL=https://github.com/git-lfs/git-lfs/releases/download/v2.0.0/git-lfs-darwin-amd64-2.0.0.tar.gz \ | ||
GIT_LFS_CHECKSUM=fde18661baef286f0a942adf541527282cf8cd87b955690e10b60b621f9b1671 \ | ||
script/build-macos.sh ./git /tmp/build/git/ | ||
``` | ||
|
||
**NOTE:** one potential way to tidy this up could be to have helper scripts read out the details of the `.travis.yml` file so you don't have to duplicate the work. | ||
|
||
For example, it could distill down to: | ||
|
||
``` | ||
./test macOS /tmp/build/git | ||
``` | ||
|
||
This would mean the contributor doesn't need to care about changes to how the pipeline works, and can focus on the behaviour of the scripts. |