Skip to content

Add upstream to forked repositories - #3199

Merged
iAmWillShepherd merged 28 commits into
masterfrom
whats-upstream
Nov 2, 2017
Merged

iAmWillShepherd merged 28 commits into
masterfrom
whats-upstream

Conversation

@joshaber

@joshaber joshaber commented Oct 30, 2017 •

Copy link
Copy Markdown
Contributor

Fixes #2364

  1. When a repository is selected, check if it's a fork.
  2. If it's a fork, check if it has an upstream remote.
  3. If it doesn't, add it.
  4. If it does, check if it equals the remote we would have added.
  5. If it doesn't, ask the user if they wanna update it.

@joshaber

Copy link
Copy Markdown
Contributor Author

I could use some 🤔 on this dialog. On the one hand, I wanna give them as much context as possible. On the other hand, this is pretty overwhelming as-is.

screen shot 2017-10-30 at 3 53 22 pm

@desktop/core thoughts?

@joshaber joshaber added the ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Oct 30, 2017
@joshaber

Copy link
Copy Markdown
Contributor Author

This is ready 🙏 Though as I said above I'd like feedback specifically about the copy on that dialog ☝️

@lee-dohm

Copy link
Copy Markdown
Contributor

@joshaber I would use something like this for the dialog body text:

The repository react-native-interactable is a fork of wix/react-native-interactable but its upstream remote doesn't appear to point to wix/react-native-interactable as we would expect. Would you like us to set the upstream remote to the expected value for you?

  • Current: https://github.com/wix/react-native-interactablasde.git
  • Expected: https://github.com/wix/react-native-interactable.git

Also, if they don't choose to update the upstream remote, is there anything that might not work as expected?

@haacked

haacked commented Oct 30, 2017 •

Copy link
Copy Markdown
Contributor

I was just going to suggest what @lee-dohm did. For non-github repos, we could show the full URL. For GitHub repos, we could tooltip the name/owner to show the full URL.

Also, we may not need to repeat the fork name/owner pair in the message.

The repository react-native-interactable is a fork of wix/react-native-interactable but its upstream remote points elsewhere. Would you like us to set the upstream remote to the expected value for you?

Current: https://github.com/wix/react-native-interactablasde.git
Expected: https://github.com/wix/react-native-interactable.git

@joshaber

joshaber commented Oct 31, 2017 •

Copy link
Copy Markdown
Contributor Author

Thanks @lee-dohm @haacked 💖

Updated:

screen shot 2017-11-01 at 9 52 19 am

<p>
Would you like to update the <Ref>{UpstreamRemoteName}</Ref> remote
to use the expected URL?
• Current: <Ref>{existingURL}</Ref>

This comment was marked as spam.

This comment was marked as spam.

@iAmWillShepherd iAmWillShepherd self-assigned this Nov 2, 2017
Comment thread app/src/lib/stores/app-store.ts Outdated
): Promise<boolean> {
const key = this.getIgnoreExistingUpstreamRemoteKey(repository)
const value = localStorage.getItem(key)
return Promise.resolve(value ? true : false)

This comment was marked as spam.

parent: GitHubRepository,
remotes: ReadonlyArray<IRemote>
): IRemote | null {
const upstream = remotes.find(r => r.name === UpstreamRemoteName)

This comment was marked as spam.

This comment was marked as spam.

@joshaber

joshaber commented Nov 2, 2017

Copy link
Copy Markdown
Contributor Author

giphy-2

Comment thread app/src/lib/stores/app-store.ts Outdated
const key = this.getIgnoreExistingUpstreamRemoteKey(repository)
const value = localStorage.getItem(key)
return Promise.resolve(value ? true : false)
return Promise.resolve(value === '1' ? true : false)

This comment was marked as spam.

@iAmWillShepherd
iAmWillShepherd merged commit 38356f7 into master Nov 2, 2017
@iAmWillShepherd
iAmWillShepherd deleted the whats-upstream branch November 2, 2017 19:03
@scottnath scottnath mentioned this pull request Nov 6, 2017
@tooomm

tooomm commented Nov 7, 2017

Copy link
Copy Markdown

just updated my client to 1.0.7

but i get this dialog in a loop now:
fork

two confusions here:

  • why is the current link identical to the expected one?
  • why do i see this dialog every time i switch to that fork? even after hitting update ?

@j-f1

j-f1 commented Nov 7, 2017

Copy link
Copy Markdown
Contributor

@tooomm Can you open a new issue and fill out the template so we can better help you?

@tooomm

tooomm commented Nov 7, 2017

Copy link
Copy Markdown

sure --> #3252

@KirkMunro

Copy link
Copy Markdown

With this fix, will the repository properties dialog show both the origin and upstream repositories?

Do you know when this fix will ship?

@iAmWillShepherd

Copy link
Copy Markdown
Contributor

With this fix, will the repository properties dialog show both the origin and upstream repositories?

@KirkMunro , no this PR deals only with allowing you to checkout a branch from a fork. We are planning on shipping sometime this month.

@shiftkey

Copy link
Copy Markdown
Member

@KirkMunro please open a new issue if you would like to see the upstream remote URL in the repository settings dialog

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

Labels

ready-for-review Pull Requests that are ready to be reviewed by the maintainers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants