Improve pull request command line instructions (#27778)

* Show checkout instructions also when there is no permission to push,
for anyone who wants to locally test the changes.
* First checkout the branch exactly as is, without immediately having to
solve merge conflicts. Leave this to the merge step, since it's often
convenient to test a change without worrying about this.
* Use `git fetch -u`, so an existing local branch is updated when
re-testing the same pull request. But not the more risky `git fetch -f`
in to handle force pushes, as we don't want to accidentally overwrite
important local changes.
* Show different merge command depending on the chosen merge style,
interactively updated.
This commit is contained in:
Brecht Van Lommel 2023-10-25 17:01:31 +02:00 committed by GitHub
parent 1eae2aadae
commit 7a286e4753
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 47 additions and 18 deletions

View file

@ -1,5 +1,6 @@
<script>
import {SvgIcon} from '../svg.js';
import {toggleElem} from '../utils/dom.js';
const {csrfToken, pageData} = window.config;
@ -39,6 +40,9 @@ export default {
watch: {
mergeStyle(val) {
this.mergeStyleDetail = this.mergeForm.mergeStyles.find((e) => e.name === val);
for (const elem of document.querySelectorAll('[data-pull-merge-style]')) {
toggleElem(elem, elem.getAttribute('data-pull-merge-style') === val);
}
}
},
created() {