Lets try "code owners" https://help.github.com/en/github/creat ... ode-owners feature.
First PR.
https://github.com/freeorion/freeorion/pull/2894
The Git/GitHub Questions, Answers and Howto Thread
Moderator: Committer
Re: The Git/GitHub Questions, Answers and Howto Thread
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0
Re: The Git/GitHub Questions, Answers and Howto Thread
Best way to make PRs that depend on other not-merged PRs?
Say I have PR Feature-1 waiting for approval, and I want to start working on another PR Feature 2 that depends on "Feature 1", and eventually pushing it before Feature-1 was merged. What is the preferred way to make the branching, commits and push to minimise merge conflicts and keep a tidy commit history?
Can I just do?
(edit)
Say I have PR Feature-1 waiting for approval, and I want to start working on another PR Feature 2 that depends on "Feature 1", and eventually pushing it before Feature-1 was merged. What is the preferred way to make the branching, commits and push to minimise merge conflicts and keep a tidy commit history?
Can I just do
Code: Select all
git checkout Feature-1
git checkout -b Feature-2
// hack hack hack
git commit -a -m "This is Feature-2, follow up of Feature-1"
git push origin Feature-2
(edit)
Re: The Git/GitHub Questions, Answers and Howto Thread
Well, yeah. Technically you can. Note, that any PR from Feature-2 to upstream/master will contain also commits from Feature-1. If Feature-1 is merged before Feature-2 it won't be a problem, as the commit is the same (same hash, same parents) and Feature-2 PR will no longer include Feature-1 changes in its commit list (as they will already have been in master). If Feature-2 is merged before Feature-1, Feature-1 PR becomes a no-op, because Feature-2 will have already merged all changes from Feature-1 into master.
https://github.com/mmoderau
[...] for Man has earned his right to hold this planet against all comers, by virtue of occasionally producing someone totally batshit insane. - Randall Munroe, title text to xkcd #556
[...] for Man has earned his right to hold this planet against all comers, by virtue of occasionally producing someone totally batshit insane. - Randall Munroe, title text to xkcd #556
Re: The Git/GitHub Questions, Answers and Howto Thread
Then... Feature-2 PR could indicate that it supersedes Feature-1 when pushed to master (if Feature-1 wasn't merged)?
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13586
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: The Git/GitHub Questions, Answers and Howto Thread
The main problem with those pull requests that include stuff from other pull requests is that it's harder to review the later pull request with the older stuff also in the changes.
Noting in the description that another pull request is included or that the latter one depends on the former is a good practice, though, I think.
Noting in the description that another pull request is included or that the latter one depends on the former is a good practice, though, I think.
Re: The Git/GitHub Questions, Answers and Howto Thread
One non-obvious feature of GitHub is review requests after feedback.
When a person approves/comments/requests changes his name is still present on the review page, but actually, the review request was fulfilled. To request a review again you need to click on rotation arrows near the reviewer name. This feature gives you the flexibility to push multiple times before requesting the review again. GitHub has a dashboard for review requests, so you could easily check what should you review next.
https://github.com/pulls/review-requested.
When a person approves/comments/requests changes his name is still present on the review page, but actually, the review request was fulfilled. To request a review again you need to click on rotation arrows near the reviewer name. This feature gives you the flexibility to push multiple times before requesting the review again. GitHub has a dashboard for review requests, so you could easily check what should you review next.
https://github.com/pulls/review-requested.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0
Re: The Git/GitHub Questions, Answers and Howto Thread
If you want to checkout a branch from another fork you need to add another remote.
For example, I want to get Grummel7s branch AIwithPolicies on my machine.
Fetch all branches from remote.
Checkout branch, by its name.
You could even push changes to this branch, but you need to ask about access from the repo owner first.
For example, I want to get Grummel7s branch AIwithPolicies on my machine.
Code: Select all
git remote add Grummel7 https://github.com/Grummel7/freeorion.git
- Grummel7 is a name that will be shown in your console, you could put any, I usually use user name.
- https://github.com/Grummel7/freeorion.git is repo address from GitHub page. Use ssh or HTTP. You could always check which method you use by checking origin on the output of git remote -v
Code: Select all
git fetch Grummel7
Code: Select all
git checkout AIwithPolicies
You could even push changes to this branch, but you need to ask about access from the repo owner first.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0