git ssb

30+

cel / git-ssb-web



Commit 637b4ab0a73fd368e34635e3de948f5f0c4b244b

Add PR CLI merge instructions

Charles Lehner committed on 4/11/2016, 2:49:18 AM
Parent: 15209016c9f99db95578158f7ba1bef4f4894a9b

Files changed

index.jschanged
static/styles.csschanged
index.jsView
@@ -2165,9 +2165,29 @@
21652165 return renderIssueActivityMsg(repo, pr,
21662166 'pull request', postId, item)
21672167 })
21682168 ),
2169- isPublic ? pull.empty() : readOnce(function (cb) {
2169 + !isPublic && isAuthor && pull.once(
2170 + '<section class="merge-instructions">' +
2171 + '<input type="checkbox" class="toggle" id="merge-instructions"/>' +
2172 + '<h4><label for="merge-instructions" class="toggle-link"><a>' +
2173 + 'Merge via command line…' +
2174 + '</a></label></h4>' +
2175 + '<div class="contents">' +
2176 + '<p>Check out the branch and test the changes:</p>' +
2177 + '<pre>' +
2178 + 'git fetch ssb://' + escapeHTML(pr.headRepo) + ' ' +
2179 + escapeHTML(pr.headBranch) + '\n' +
2180 + 'git checkout -b ' + escapeHTML(pr.headBranch) + ' FETCH_HEAD' +
2181 + '</pre>' +
2182 + '<p>Merge the changes and push to update the base branch:</p>' +
2183 + '<pre>' +
2184 + 'git checkout ' + escapeHTML(pr.baseBranch) + '\n' +
2185 + 'git merge ' + escapeHTML(pr.headBranch) + '\n' +
2186 + 'git push ssb ' + escapeHTML(pr.baseBranch) +
2187 + '</pre>' +
2188 + '</div></section>'),
2189 + !isPublic && readOnce(function (cb) {
21702190 cb(null, renderIssueCommentForm(pr, repo, newestMsg.key, isAuthor,
21712191 'pull request'))
21722192 })
21732193 ])
@@ -2350,9 +2370,8 @@
23502370 var currentDay
23512371 return cb(null, pull(
23522372 headRepo.readLog(headBranch),
23532373 pull.take(function (rev) { return rev != baseBranchRev }),
2354- // pull.take(2),
23552374 pullReverse(),
23562375 paramap(headRepo.getCommitParsed.bind(headRepo), 8),
23572376 pull.map(function (commit) {
23582377 var commitPath = [baseRepo.id, 'commit', commit.id]
static/styles.cssView
@@ -147,8 +147,9 @@
147147 margin-left: .25ex;
148148 }
149149
150150 .name-checkbox,
151 +.toggle,
151152 .tab-radio {
152153 position: absolute;
153154 opacity: 0;
154155 font-size: 0;
@@ -402,4 +403,19 @@
402403
403404 .pr-tab-links {
404405 margin: .5em 0 0.25em;
405406 }
407 +
408 +.merge-instructions {
409 + margin-top: .5em;
410 +}
411 +
412 +#merge-instructions:not(:checked) + h4 .toggle-open,
413 +#merge-instructions:checked + h4 .toggle-closed,
414 +#merge-instructions:not(:checked) ~ .contents {
415 + display: none;
416 +}
417 +
418 +.toggle-link {
419 + color: #006eff;
420 + font-weight: normal;
421 +}

Built with git-ssb-web