Cali0707 / git-utils

A collection of useful git tools
Apache License 2.0
3 stars 2 forks source link

Make PR command #4

Open Cali0707 opened 1 year ago

Cali0707 commented 1 year ago

This command would just open the make PR window in the browser, sort of like if you clicked on the PR link when you first push a change to a new branch.

In order for this to be complete, the following tasks must be finished:

Cali0707 commented 11 months ago

Per conversation with @Leo6Leo:

git make-pr -r <remote_name: defaults to upstream>
            -u <remote_url: if provided, overrides -r>
            -s <: whether or not to stash any uncommited changes>
            -c <commit_message: commit uncomitted but staged changes with commit_message>
Cali0707 commented 11 months ago

If -s and -c are provided, it will:

  1. commit any staged changes
  2. stash any remaining changes

If after following this resolution process there are any remaining unstashed/uncommitted changes the command will fail. @Leo6Leo do you think we should also add a -f flag which will force the command to make the PR even if there are remaining unstashed/uncommited changes?

Leo6Leo commented 11 months ago

If -s and -c are provided, it will:

  1. commit any staged changes
  2. stash any remaining changes

If after following this resolution process there are any remaining unstashed/uncommitted changes the command will fail. @Leo6Leo do you think we should also add a -f flag which will force the command to make the PR even if there are remaining unstashed/uncommited changes?

I think it's generally advised to ensure that there are no uncommitted/unstashed changes before making a PR. This is to make sure that the changes being proposed are clear, complete, and can be easily reviewed and tested by others.

But things happens sometimes, adding a -f flag (force flag) could potentially be useful, but it should be used with caution. We might need to highlight the potential risks involved in using this flag (like causing confusion for reviewers or even introducing bugs if the changes are not fully ready), and it should generally be discouraged unless there's a clear need for it. @Cali0707