Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Conversation

Projects
None yet
2 participants
@jerone
Copy link
Contributor

commented May 30, 2019

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).
@bfred-it
Copy link
Collaborator

left a comment

🦋

Show resolved Hide resolved source/features/more-dropdown.tsx Outdated
Show resolved Hide resolved source/features/more-dropdown.tsx Outdated
Show resolved Hide resolved source/features/more-dropdown.tsx Outdated
Show resolved Hide resolved source/features/more-dropdown.tsx
@jerone

This comment has been minimized.

Copy link
Contributor Author

commented May 30, 2019

Processed your feedback and fixed linting.

@bfred-it bfred-it 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 some commits May 31, 2019

Moved ref detection to utils & added tests
Fix compare detection.
Add blame detection.
Prioritized order.

@bfred-it bfred-it force-pushed the sindresorhus:master branch from 5df5c5f to 5f1a966 Jun 1, 2019

@bfred-it

This comment has been minimized.

Copy link
Collaborator

commented Jun 2, 2019

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

This comment has been minimized.

Copy link
Contributor Author

commented Jun 2, 2019

Removed compare & tags/releases detection.

@bfred-it

This comment has been minimized.

Copy link
Collaborator

commented Jun 2, 2019

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

jerone added some commits Jun 2, 2019

@jerone

This comment has been minimized.

Copy link
Contributor Author

commented Jun 2, 2019

Removed PR commit detection too.

@bfred-it bfred-it 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

@bfred-it bfred-it merged commit 0a6b6b4 into sindresorhus:master Jun 4, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@bfred-it

This comment has been minimized.

Copy link
Collaborator

commented Jun 4, 2019

Thanks @jerone 🍫

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

@jerone

This comment has been minimized.

Copy link
Contributor Author

commented Jun 4, 2019

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
You can’t perform that action at this time.