neel1996/gitconvex

Stage all and commit automatically.

Nageswari-droid opened this issue · 3 comments

Is your feature request related to a problem? Please describe.
No

Describe the solution you'd like
If the client click on commit changes before staging operation then all the files will be staged automatically.

Describe alternatives you've considered
Not applicable

Additional context
None

Suggestion

This feature does not require a separate API to carry out the operation. From the UI, the component for committing the changes can be redesigned to call the "stage all" api and on successful response, the "commit changes" api can be invoked with a proper commit message.

How can I proceed?

If a user clicks on "Commit changes" button before staging, instead of displaying "No Staged files to commit" it should list all the untracked/modified/deleted files with a proceed button like "Stage all and commit". Am I right about it or how you are expecting?

@Nageswari-droid Currently, when "Commit changes" is clicked, it will not let the user do it when there are no staged files available. As part of this feature, that condition needs to be changed to check for all the worktree changes and let the user "Stage all the changes and commit it" in a single click

The gitChanges query returns the worktree changes from the target repo.

gitChanges(repoId: String!) {
    gitUntrackedFiles: [String]!
    gitChangedFiles: [String]!
}

If the arrays are empty then appropriate warning should be thrown, or else the commit should be allowed after staging all the changes.