Skip to content

[NEW] add a new/private file to source control  #434

Open

Description

@SRombautsU

When creating a new file through Visual Studio Code, its status is "Private" 'P', and there is no way to add it to source control.

There should be a context menu action with the option to add it to source control (or "Checkout" like Plastic SCM GUI call it)

As a comparison, it appears as "Untracked" in git, but then you have the option to Stage it which add it to source control.

Activity

  1. givetimetolife commented on Feb 2, 2023

    @givetimetolife

    Hello, is there any progress on this issue? I'm interested in solving this problem, can you provide some plastic advice? @SRombautsU

  2. mig42 commented on Feb 2, 2023

    @mig42
    Contributor

    Hi! Unfortunately from our side there isn't any VSCode plugin work planned for this quarter. Are you interested in contributing to the repo? If that's the case, I can give you some references to get you on track 🙂

  3. givetimetolife commented on Feb 3, 2023

    @givetimetolife

    Thanks for your reply! I'm interested in solving this problem and plan to start working today 🍻

  4. mig42 commented on Feb 3, 2023

    @mig42
    Contributor

    In that case, you can take a look at how menus are built for Source Control extensions in the VS Code Extension docs. It would be a matter of adding a "+" button that triggers a Plastic SCM Add command. After that command runs, the extension will reload the status to acknowledge the changes in the workspace. The targeted file should now be controlled (i.e. "Added" instead of "Private") and subject to checkin.

    Said command would ultimately call cm add via the cm shell that is up and running for the workspace. You can have a look at other commands (e.g. checkin) for reference.

    In the future we might want to separate by categories (controlled vs. local changes, or even more fine-grained) and have the "+" button perform an "add" or "checkout" action depending on the item status, but I think this is a good first pass for now.

  5. givetimetolife commented on Feb 6, 2023

    @givetimetolife

    Hi, I started developing the vscode plastic plugin last friday, and today I continue to start working on.

    If only to implement add a new/private file to source control, we only need to do commit.
    But I think this is not good, because many times we don't need to commit all the changes (modify, add, delete, move...)

    So I want to use cm to implement two workspaces Changes / Staged Changes We only CheckIn what is in the Staged Changes workspace. But I have some problems:

    If it is added/moved change, we can click + to call cm add/undo to judge the status of TypeVerbose Private <=> Added/Moved, and realize workspace Changes / Staged Changes.

    But if it's a deleted/modify change, I can't mark it with cm...

    Is there any other way for CM to support this behavior? Should I create a separate variable to store the changed state?

    @mig42

  6. mig42 commented on Feb 7, 2023

    @mig42
    Contributor

    The key here would be to get private files under control. That's achieved by running a cm add command to the file. That way, it will be included in the checkin along with any other change in the workspace.

    What you're referring to is a desired functionality (being able to explicitly select what's included in the checkin), but it falls out of the scope of this particular issue 😃 We'd need to address that in a separate one.

  7. givetimetolife commented on Feb 8, 2023

    @givetimetolife

    I tried usingcm addto solve this, but I don't know how to indicate that the file has been "added" (ui design), so I want to implement workspace Changes / Staged Changes ie (being able to explicitly select what's included in the checkin)

  8. givetimetolife commented on Feb 8, 2023

    @givetimetolife

    For the function of the plug-in, we can quickly solve it by calling plastic-client-core through js, I can't think of a good solution for the plastic plugin ui design... Do you have any good suggestions? I think this is my biggest difficulty

  9. mig42 commented on Feb 8, 2023

    @mig42
    Contributor

    I tried usingcm addto solve this, but I don't know how to indicate that the file has been "added" (ui design), so I want to implement workspace Changes / Staged Changes ie (being able to explicitly select what's included in the checkin)

    I'm not against this at all! Just saying that it's a different issue and it should be handled as such.

    Added files are represented differently from private files. They're different changes, as private files aren't controlled by version control, whereas added files are. You can try that by using a Plastic client (GUI or CLI) to add a private file in your workspace and then refreshing the Plastic Version Control section inside Visual Studio Code.

    For the function of the plug-in, we can quickly solve it by calling plastic-client-core through js, I can't think of a good solution for the plastic plugin ui design... Do you have any good suggestions? I think this is my biggest difficulty

    I'm not sure what you mean by that. Could you clarify?

  10. givetimetolife commented on Feb 15, 2023

    @givetimetolife

    plastic-scm-0.1.3.vsix.zip

    What do you think of this plugin design? @mig42

  11. mig42 commented on Feb 15, 2023

    @mig42
    Contributor

    Do you have a branch or a PR that I can review?

  12. givetimetolife commented on Feb 15, 2023

    @givetimetolife

    This PR is currently in WIP status (the code is a bit messy, there is no error handling), just to verify whether the way to implement the function is correct.

    #505

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions