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

Feature: Git Integration #12020

Merged
merged 23 commits into from
Apr 19, 2023
Merged

Conversation

ferrariofilippo
Copy link
Contributor

@ferrariofilippo ferrariofilippo commented Apr 8, 2023

Resolved / Related Issues

  • Were these changes approved in an issue or discussion with the project maintainers? In order to prevent extra work, feature requests and changes to the codebase must be approved before the pull request will be reviewed. This prevents extra work for the contributors and maintainers.
    Related Feature: Git integration #11014

Validation
How did you test these changes?

  • Did you build the app and test your changes?
  • Did you check for accessibility? You can use Accessibility Insights for this.
  • Did you remove any strings from the en-us resource file?
    • Did you search the solution to see if the string is still being used?
  • Did you implement any design changes to an existing feature?
    • Was this change approved?
  • Are there any other steps that were used to validate these changes?

Screenshots (optional)
1

@ferrariofilippo ferrariofilippo marked this pull request as draft April 8, 2023 20:01
@yaira2
Copy link
Member

yaira2 commented Apr 9, 2023

I think we need to finalize the requirements before reviewing this.

@0x5bfa
Copy link
Member

0x5bfa commented Apr 9, 2023

Requirements:

  • Following things should be showed even when you're exploring git subfolders.
    • Show the current branch name on status bar
    • Show Push button on status bar
    • Show Pull button on status bar
    • Show Sync button on status bar
    • Show Add Branch button on status bar
    • Show Checkout Branch button on status bar

Actions such as push, sync, add branch to the upstream are needed to be authorized by the user and GitHub. There're two ways to implement.

Way Used in Description
Username/Password Visual Studio (Code) (Duplicated)
Show a dialog to prompt to enter username and password in Files, send them to GitHub and request to authorize.
Security Token GitHub Desktop
FluentHub
JitHub
We have to keep a token in app installation folder.
Can be created in the files-community settings

@ferrariofilippo
Copy link
Contributor Author

Requirements:

  • Following things should be showed even when you're exploring git subfolders.
    • Show the current branch name on status bar
    • Show Push button on status bar
    • Show Pull button on status bar
    • Show Sync button on status bar
    • Show Add Branch button on status bar
    • Show Checkout Branch button on status bar

They are already shown in subfolders, I just need to make them work
(use user's credentials and add a menu for checkout).
I think that instead of a Checkout button, we might show that menu when the user clicks on the branch name (As in VS)

@yaira2
Copy link
Member

yaira2 commented Apr 9, 2023

Let's move the discussion to the issue

@ferrariofilippo ferrariofilippo marked this pull request as ready for review April 14, 2023 09:08
@ferrariofilippo
Copy link
Contributor Author

ferrariofilippo commented Apr 14, 2023

At the moment, if you change the active branch using an external app (such as GitHub Desktop) you have to manually update the page. I'll try to find a way to fix that

Edit. I found a way to make it work if any items changed with the checkout

@yaira2 to make the branch name auto update, I should add a watcher that looks for all the changes in all the subdirectories of the git repository. It would be enabled for git repositories only, but still it would affect performances.
We could also use the already existing watcher and make it watch for subfolders only if it is a git directory (it should watch from the root of it). Not working properly
What should I do?

@ferrariofilippo
Copy link
Contributor Author

Now the branch name is auto updated

@ferrariofilippo ferrariofilippo marked this pull request as draft April 15, 2023 14:57
@ferrariofilippo ferrariofilippo marked this pull request as ready for review April 15, 2023 15:24
@ferrariofilippo
Copy link
Contributor Author

@gave92 can you review the changes to ItemViewModel?

Copy link
Member

@yaira2 yaira2 left a comment

Choose a reason for hiding this comment

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

LGTM

@yaira2 yaira2 added the ready to merge Pull requests that are approved and ready to merge label Apr 19, 2023
@yaira2 yaira2 merged commit 3e441e2 into files-community:main Apr 19, 2023
@ferrariofilippo ferrariofilippo deleted the Git_Integration branch April 20, 2023 05:26
ferrariofilippo added a commit to ferrariofilippo/Files that referenced this pull request Apr 22, 2023
@barisunsalhn
Copy link

How to activate this ? using 2.4.71.0 and also checked to on my local repo

commit 6d7c29d4037362602f2146cb0b9fab504999d18b (HEAD -> main, origin/main, origin/HEAD)
Author: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Date:   Fri Jun 2 01:59:28 2023 -0400

and it did not show up? Cannot see branch name at the bottom right as in first ss on this pr?
https://user-images.githubusercontent.com/102259289/232000382-0787e9f3-c269-424e-887b-67b47eb1cab0.png

@yaira2
Copy link
Member

yaira2 commented Jun 4, 2023

@lapaz17 thank you for your interest, the git integration is currently available in the preview version https://files.community/download. We're adding some more features to the integration, but it'll be good to hear your first impressions once you start using it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to merge Pull requests that are approved and ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants