Skip to content

Link to current branch in More's Compare and Commits links - #2102

Merged
fregante merged 8 commits into
refined-github:masterfrom
jerone:features/jvw-#1197-branchify-compare-commits
Jun 4, 2019
Merged

fregante merged 8 commits into
refined-github:masterfrom
jerone:features/jvw-#1197-branchify-compare-commits

Conversation

@jerone

@jerone jerone commented May 30, 2019 •

Copy link
Copy Markdown
Contributor

Description

Include current ref (branch or tag) in compare & commit repo links added in more-dropdown. Different pages required different detection to get the current ref (branch or tag).

Extra

Optionally I can include the default branch, but that requires an extra API call and is not necessary.

Closes

Closes #1197.

Test

  1. Visit any of the below urls.
  2. Open repo tab "More" -> "Compare" or "Commits".
  3. See it link to the correct tree (branch or tag).

@fregante fregante left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🦋

Comment thread source/features/more-dropdown.tsx Resolved
Comment thread source/features/more-dropdown.tsx Resolved
Comment thread source/features/more-dropdown.tsx Resolved
Comment thread source/features/more-dropdown.tsx Resolved
@jerone

jerone commented May 30, 2019

Copy link
Copy Markdown
Contributor Author

Processed your feedback and fixed linting.

@fregante fregante changed the title Include current branch/tag in compare & commit repo links. Closes #1197 Include current branch/tag in compare & commit repo links May 31, 2019
jerone added 2 commits May 31, 2019 11:05
Fix compare detection.
Add blame detection.
Prioritized order.
@fregante

fregante commented Jun 2, 2019 •

Copy link
Copy Markdown
Member

I don't think this should affect Compare pages. The only reason why I'd use that link when already on the Compare page would be to "reset the view"

Tags shouldn't be affected either, e.g. https://github.com/BrowserSync/browser-sync/releases/tag/v2.26.3, for two reasons:

  • The generated link is always empty (master...v2.26.3)
  • There's already a compare link on the page named "8 commits on master since this tag", which compares in the right direction (v2.26.3...master)

@jerone

jerone commented Jun 2, 2019

Copy link
Copy Markdown
Contributor Author

Removed compare & tags/releases detection.

@fregante

fregante commented Jun 2, 2019

Copy link
Copy Markdown
Member

I just saw isPRCommit too, that also should probably be dropped, it's too specific I think

@jerone

jerone commented Jun 2, 2019

Copy link
Copy Markdown
Contributor Author

Removed PR commit detection too.

@fregante fregante changed the title Include current branch/tag in compare & commit repo links Link to current branch in More's Compare and Commits links Jun 4, 2019
@fregante
fregante merged commit 0a6b6b4 into refined-github:master Jun 4, 2019
@fregante

fregante commented Jun 4, 2019

Copy link
Copy Markdown
Member

Thanks @jerone 🍫

@jerone
jerone deleted the features/jvw-#1197-branchify-compare-commits branch June 4, 2019 18:32
@jerone

jerone commented Jun 4, 2019

Copy link
Copy Markdown
Contributor Author

More LOC for tests, then for the real fix. 🎉😂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

"Compare" repo link should include the current branch/tag

2 participants