fork-dev / TrackerWin

Bug and issue tracker for Fork for Windows
461 stars 10 forks source link

[Feature Request] New branch name template #1013

Open RaptorCZ opened 4 years ago

RaptorCZ commented 4 years ago

I would like to have option to set default branch name. We have convention for feature branches in pattern "feature/XX-123456_abc" and I want to set "feature/XX-" as template and then just type ID etc.

jerone commented 4 years ago

Yes, if Fork could enforce this, that would be great. We have a similar convention.


Right now, I solved it with githooks:

  1. Create a folder named .githooks (or any other name) in your repo.
  2. Create 3 files in that folder (no extension):
    • commit-msg
    • pre-commit
    • pre-push
  3. Paste the template from below in all of those 3 files.
  4. Within your repo, execute the following command on all your coworkers environments:
    git config core.hooksPath .githooks
GitHooks template ```sh #!/bin/sh local_branch="$(git rev-parse --abbrev-ref HEAD)" # Rebasing detection. rebasing=false rebasing_branch=$(git branch | grep '*' | sed 's/* //') rebasing_branch_regex="^\(no branch, rebasing.*" if [[ "$rebasing_branch" =~ $rebasing_branch_regex ]]; then rebasing=true #echo "You are rebasing: $rebasing_branch" else rebasing=false #echo "You are NOT rebasing: $rebasing_branch" fi ################################################################### # # # The following code checks if branch name adheres to contract. # # # ################################################################### valid_branch_regex="^(backup\/)?(((feature|bugfix|hotfix)\/(#[1-9][0-9]*[a-z0-9\._-]*|#0-[a-z0-9\._-]+))|release\/sprint-[1-9][0-9]*)$" # Validate branch name, when we are in the middle of an rebase. if [[ "$rebasing" = false ]] && [[ ! "$local_branch" =~ $valid_branch_regex ]]; then echo "Your branch name is incorrect!" echo "Branch: $local_branch" exit 1 fi exit 0 ```
DanPristupov commented 3 years ago

In 1.62 we added autocomplete for the existing folders:

Screenshot 2021-05-07 at 18 08 55
jerone commented 3 years ago

Great feature!

In most IDE's pressing the tab will auto-fill the selected item (which should be the first item) in the (intellisense) menu. Could that be an improvement here?

Also alignment looks different for me:

DanPristupov commented 3 years ago

In most IDE's pressing the tab will auto-fill the selected item (which should be the first item) in the (intellisense) menu.

I'd rather not handle the tab key as it's a system key and error-prone... However I agree, pressing Enter must auto-fill the first item.

Also alignment looks different for me:

Weird. Does this happen all the time? I tried on different monitors with different DPI and it worked properly.

Could you try to run this build and send me the log file (%localappdata%\fork\logs\fork.log) to support@fork.dev, please? The log will show the coordinates the popup being shown at.

https://cdn.fork.dev/prerelease/Fork-1.62.1.zip

RaptorCZ commented 3 years ago

I agree that Tab to finish autocomplete is "standard" way in any IDE. Using Enter and Tab are 2 different things. One inserts and other overwrites.

I have the same problem with autocomplete position.

jerone commented 3 years ago

Enter with the the first item pre-selected in the menu would work for me. 👍

Does this happen all the time?

Yes, constantly.

It looks like the menu is aligned to the right, from path separator.

Here a screenshot of the root folder level:

Here a screenshot of the second folder level:

One screen. Windows scaling: 100%

E-mail send.

DanPristupov commented 3 years ago

@jerone thank you very much for the log 👍.

Can you try if this version shows the popup at the correct position? https://cdn.fork.dev/prerelease/Fork-1.62.2.zip

jerone commented 3 years ago

@DanPristupov No difference:

E-mail send with log containing above screenshot.